How to add multiple JMS MessageListners in a single MessageListenerContainer for Spring Java Config

前端 未结 3 944
时光说笑
时光说笑 2021-01-17 22:22

I had the following xml code in my spring-config.xml



        
相关标签:
3条回答
  • 2021-01-17 22:43

    You can add container.setConcurrentConsumers(10);, where number of consumers is 10

    0 讨论(0)
  • 2021-01-17 22:44

    The namespace is just a convenience - each <jms:listener/> element gets its own DMLC; the outer (container) element is just a vehicle to supply common attributes.

    0 讨论(0)
  • 2021-01-17 22:49

    You can add multiple annotations, each with its own concurrency.

    @JmsListener(id="1", destination = "mydestination", containerFactory = "myfactory", concurrency ="1-5")
    
    @JmsListener(id="2", destination = "mydestination", containerFactory = "myfactory", concurrency = "3-5")
    
    0 讨论(0)
提交回复
热议问题