You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mhillary <ma...@no33.co.uk> on 2012/06/25 18:58:34 UTC

DefaultJmsKeyFormatStrategy Performance

Hi All,

While looking at some performance issues in our application I noticed it was
spending an unexpectedly large amount of time escaping header keys in the
DefaultJmsKeyFormatStrategy. This seems to be down to the use of
String.replace/replaceAll that are implemented using regular expressions. 

I've created a patch that uses Commons Lang StringUtil.replaceEach. In my
tests it's an order of magnitude faster than String.replace/replaceAll. I
also noticed that, for my application at least, that headers are identical
for every message so I cache the result of the escaping in a
ConcurrentHashMap.

The patch can be found here https://issues.apache.org/jira/browse/CAMEL-5396

Thanks,
Mark Hillary

--
View this message in context: http://camel.465427.n5.nabble.com/DefaultJmsKeyFormatStrategy-Performance-tp5715071.html
Sent from the Camel - Users mailing list archive at Nabble.com.