开发者

How to control in Grails app which server to consume a RabbitMQ queue

开发者 https://www.devze.com 2023-02-14 22:06 出处:网络
We have a Grails app running, and we are using the RabbitMQ plugin for exchanging messages within the application. On the production environment, we have two instances of the application deployed on t

We have a Grails app running, and we are using the RabbitMQ plugin for exchanging messages within the application. On the production environment, we have two instances of the application deployed on two servers and we have configured 10 queue consumers per instance. I would love to be a开发者_开发技巧ble to have only one of the servers consuming messages from the queue. I have found this configuration parameter:

exclusive: Only the client that created the queue can connect to it.

and I am trying to make it work. I am not exactly sure, what do they mean by "client"...Server? App instance? Consumer?

Any other ideas on controlling the queue's consumption?

Thanks in advance!


There seem to be 2 "exclusive" fields in the spec:

queue.declare: field exclusive: "Exclusive queues may only be accessed by the current connection, and are deleted when that connection closes. Passive declaration of an exclusive queue by other connections are not allowed."

basic.consume: field exclusive: "Request exclusive consumer access, meaning only this consumer can access the queue."

HTH.

0

精彩评论

暂无评论...
验证码 换一张
取 消