camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhillary <>
Subject DefaultJmsKeyFormatStrategy Performance
Date Mon, 25 Jun 2012 16:58:34 GMT
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

The patch can be found here

Mark Hillary

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message