Pooling ActiveMQ connections for Camel
In my previous camel.xml I used the following XML to set up the connection to ActiveMQ:
While this code works, each time a message is sent Camel will open a new conection to the broker. I know I’m going to be doing that a lot, and I’d prefer not to waste time opening and closing the connection every time I send a message, so I’d like to hold open a pool of connections.
By changing the camel.xml
to look like the below I can add a pool of up to 8 connections which will be held open to the broker and returned to the pool, instead of being closed, once a message has been sent.
You can verify that I've written this post by following the verification instructions:
curl -LO http://barkingiguana.com/2012/09/30/pooling-activemq-connections-for-camel.md.orig
curl -LO http://barkingiguana.com/2012/09/30/pooling-activemq-connections-for-camel.md.orig.asc
gpg --verify pooling-activemq-connections-for-camel.md.orig{.asc,}
If you'd like to have a conversation about this post, email craig@barkingiguana.com. I don't bite.