camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashwin Karpe <>
Subject Re: How to speed up JMS production?
Date Tue, 25 Oct 2011 21:09:40 GMT

Interesting, need a faster Producer, eh!!!... Usually not a good idea since
it creates pileups on the broker queues (which should ideally be clean).
Especially since in JMS a fast producer/slow consumer is not usually a good
recipe for enterprise messaging.

Having put forth my obligatory cautions, you could speed things up in the
following way. 
    1> Create a pooled dispatcher/producer i.e "activemq" should use pooled
connection factories that do not incur the cost of recycling connections,
sessions etc. Spring tends to recycle connections, sessions etc and Camel
can inherit these qualities. Pooling and setting JMS cache levels can be a
way to overcome that.
    2> Create multiple instances of such pooled dispatchers/producers and
load balance messages using round robin
    3> Give enough threads directly to the load balancer so that it is not
the route bottleneck.
    4> Ensure that the source Uri is a "direct:..." so you are using an in
memory dispatch to the route from your client application. Of course, all of
this assumes that you client application is extremely fast and that the
Camel route is slow on the pickup.
    5> If this still does not cut it, create multiple such routes involving
steps 1 thru 4.

Scary and just in time for Halloween :)...

An example of what I have stated is given below. I believe it works...

                   .to(dispatcherUri, dispatcher2Uri, dispatcher3Uri);




Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary) 

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

View raw message