Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-867

servicemix-camel performance optimizations

    XMLWordPrintableJSON

Details

    • 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...

      Attachments

        1. jbibinding_perf_changes.patch
          4 kB
          Jonathan Anstey

        Activity

          People

            ffang Freeman Yue Fang
            janstey Jonathan Anstey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: