Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Patch Available
Description
I'm attaching a few small performance optimizations to the JbiBinding in the servicemix-camel component. Nothing Earth shattering here, but there were a few cases where we were doing the same operation twice in a method when only one was required. For example, one particulary bad offender was converting a Camel Message body to a Source object twice:
public void copyFromCamelToJbi(Message message, NormalizedMessage normalizedMessage) throws MessagingException { if (message != null && message.getBody() != null) { if (message.getBody(Source.class) == null) { logger.warn("Unable to convert message body of type {} into an XML Source", message.getBody().getClass()); } else { normalizedMessage.setContent(message.getBody(Source.class)); } }
Attaching a patch shortly...