'Usage of Multiple JMS Connection Factory
I have written a JMS Listener class which will listen almost 100+ queues, once after processing, it sends back message to Response Queue again. Register this listener class for 100+ queues by programmatically using Spring JMS. In this scenario, as of now, I have used only one JMS Connection Factory had been used by the JMS Listener and JMS Template ( which is posting the message to response queue ). I could sense, using of one connection factory seems will impact the performance on message processing. Going with another JMS connection factory will make sense here?
Solution 1:[1]
The key performance objective is to re-use JMS connections, and to some degree, JMS sessions. Establishing JMS connections is relatively expensive. For message listeners, if you are changing a message filter, then you will need to use a new message listener. If you are just listening for a message on a destination, then you can reuse the message listener as well.
I would recommend using a caching/pooling connection factory and keeping your JMS connections nailed up. After that, you can try to have Spring JMS also reuse your sessions.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Doug Grove |
