简体   繁体   中英

How to set certain number of listener on one server and no listener on other server for same queue in spring amqp as we can not set 0 concurrency?

I have setup listeners on reply queues, I want those to be only on master (from where messages are queued) and other servers should have no listeners to reply queue. They should have listeners to all other queues.

Spring AMQP doesn't allow to set listener concurrency to be set to 0. So I cant set 0 listners to reply queue on slave servers.

How do I set 0 concurrency on slave servers for reply queues ?

I could do it using spring profiles. I just added "master" profile to all listener beans and activated master profile only on master server.

Few nice articles to begin with using profiles

http://diarmuidmoloney.wordpress.com/2012/04/07/spring-environments/

http://maciejwalkowiak.pl/blog/2012/03/27/spring-3-1-profiles-and-tomcat-configuration/

使用auto-startup="false" ,仅start()您要监听的容器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM