Created
May 8, 2014 20:58
-
-
Save cgorshing/008fa21c1a2501cc76a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In IdempotentRedeliveryPolicy | |
private String getIdForEvent(MuleEvent event) throws Exception | |
{ | |
if (useSecureHash) | |
{ | |
Object payload = event.getMessage().getPayload(); | |
byte[] bytes = (byte[]) objectToByteArray.transform(payload); | |
if (payload instanceof InputStream) | |
{ | |
// We've consumed the stream. | |
event.getMessage().setPayload(bytes); | |
} | |
MessageDigest md = MessageDigest.getInstance(messageDigestAlgorithm); | |
byte[] digestedBytes = md.digest(bytes); | |
return (String)byteArrayToHexString.transform(digestedBytes); | |
} | |
else | |
{ | |
return event.getMuleContext().getExpressionManager().parse(idExpression, event, true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment