camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Assigned] (CAMEL-5396) Improve performance of DefaultJmsKeyFormatStrategy
Date Tue, 28 Aug 2012 12:37:08 GMT


Claus Ibsen reassigned CAMEL-5396:

    Assignee: Claus Ibsen
> Improve performance of DefaultJmsKeyFormatStrategy
> --------------------------------------------------
>                 Key: CAMEL-5396
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jms
>    Affects Versions: 2.9.2
>            Reporter: Mark Hillary
>            Assignee: Claus Ibsen
>              Labels: patch, performance
>         Attachments: CAMEL-5396.patch, default-jms-key-strat.diff
> The current default implementation uses String.replace/replaceAll to escape the illegal
characters in the header key. This is unfortunate because replace/replaceAll are implemented
in terms of regular expressions which makes the escaping quite costly for something that is
executed for every single message. Also it's quite likely that the headers will be identical
for every single message that's published via JMS. 
> The attached patch makes two changes;
> * Use Commons Lang StringUtil.replaceEach which using a StringBuilder internally to do
the replacement. This adds a dependency on Commons Lang.
> * Cache the output of StringUtil.replaceEach in a ConcurrentHashMap. This could be moved
to a separate class if caching every key is a concern. Or this could be changed to use an

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message