I use rabbitmq java client 1.7 with corresponding server on linux (centOs) system.<div>I've got a publisher that post a message to an exchange "myExchange" with routing Key "myRoutingKey" (direct mode). </div>
<div>My system has a few consumers (say 20), each one connected to the same exchange "myExchange", binding with routing key "myRoutingKey", each consumers connected with a specific queue ("queue1" for first consumer, "queue2" for second, etc...).</div>
<div><br></div><div>I expect that each consumer will process the message, and after will deliver a response to the publisher on the replyQueue.</div><div><br></div><div>How the publisher could know that there's 20 consumers subscribing to the exchange when it publis the message?</div>
<div>The idea, is that the publisher should know the number of consumers (or queues ) that bind the routingKey to know how many responses it will expect?</div><div>Could you explain to me how to do that or give me a java example ?</div>
<div><br></div><div>Other point, to assume high avaibility, I could have more than one consumer on the same queue. In these case, all consumers connected to the same queue have established a "direct" connexion to assume that only one consumer subscribed to the same queue will process the message. In these case, the publisher should get only one information (the number of distinct queues, not the number of consumers on one queue).</div>
<div><br></div><div>Thank you in advance,</div><div><br></div>