basic.qos(0) means "no limit" and RabbitMQ will push all the messages at
you. Unlikely to be what you want.
I don't think there's a completely beautiful answer to your question.
a) Have the slow link poll with (passive?) queue.declare()s. The
declare-ok you get back will tell you the number of messages in the
queue at the time the declare was received.
b) Do the same, but using HTTP to the management plugin. You have to use
another protocol, which is a pain, but you can poll a ton of queues with
one request, so that may be useful.
c) Have the slow link consume with qos(1) and acks. Every time it gets a
message, it cancels its consumer and rejects the message (with
requeue=true). Then the fast link fires up, does its consuming, shuts
down again, then the slow link starts its consumer again. The bad news
is that the first message always gets its requeued flag set. The good
news is, no polling.
On 23/02/12 09:51, Cermak, Marek wrote:
> Hello everybody,
> in our scenario we use two different connections to rabbitmq server –
> one is using a slow and permanently open link the second is very fast
> but opens only on demand and should be closed once it is not in use.
> These two connection we want to use for consuming messages from many
> (tens, hundreds) queues in the following way
> 1.open the connection on a slow link and "watch" the queues;
> 2.once there is a message in one of the watched queues, the client
> receives a notification (no message) from rabbit;
> 3.client opens the fast link, consumes available messages from queues
> and closes the link;
> 4.back to #2.
> How can we achieve this with AMQP (0.9.1 or 1.0) ? Can we do it with no
> RabbitMQ protocol extension?
> I was thinking about channel.basicQoS(0) but what would I get in that case?
> Thank you for your help.
> rabbitmq-discuss mailing list
> rabbitmq-discuss@... > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss