How can I handle multiple messages concurrently from a JMS topic (not queue) with java and spring 3.0?

后端 未结 9 846
無奈伤痛
無奈伤痛 2020-12-05 19:10

Note that I\'d like multiple message listeners to handle successive messages from the topic concurrently. In addition I\'d like each message listener to operate transaction

9条回答
  •  旧巷少年郎
    2020-12-05 20:03

    Came across this question. My configuration is :

    Create a bean with id="DefaultListenerContainer", add property name="concurrentConsumers" value="10" and property name="maxConcurrentConsumers" value ="50".

    Works fine, so far. I printed the thread id and verified that multiple threads do get created and also reused.

提交回复
热议问题