[rabbitmq-discuss] RabbitMQ Consumer timeout

Alan Antonuk alan.antonuk at gmail.com
Wed Jun 26 01:36:48 BST 2013


Antony;

rabbitmq-c has very recently added an API that allows for specifying a
timeout when waiting for frames from the broker (see
https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp.h#L495 ).
 With this API is possible to implement something with a similar effect.

I will warn you that this is only in the development branch and thus hasn't
received the same amount of testing that tagged versions have, but I would
encourage you to try it out and report back any issues that come up.

-Alan


On Tue, Jun 25, 2013 at 4:56 AM, antony <antony.pulicken at gmail.com> wrote:

> Hi,
>
> This is my scenario:
>
> I have multiple instances of listeners waiting on different temp queues. In
> some of the cases, there won't be any messages published to these temp
> queues and I want these listeners to timeout so that it can free up the
> connections.
>
> I guess in Java, we can achieve this by using the overloaded method in the
> QueueingConsumer class that takes timeout as a parameter as shown below:
>
>
> /QueueingConsumer.Delivery delivery = null;
> long timeout = 2 * 60 * 1000; // 2 minutes in milliseconds
> delivery = queuingConsumer.nextDelivery(*timeout*);
> if (delivery == null) {
>   // shut down your consumer here - no events arrived
>   // before the timeout was reached
> }
> else {
>   // process the delivered message here
> }/
>
>
> 1) Does RabbitMQ C client also has a similar feature ?
>
> 2) Are there better approaches to handle this timeouts ?
>
> Please let me know.
>
> Thanks and Regards,
> Antony.
>
>
>
>
> --
> View this message in context:
> http://rabbitmq.1065348.n5.nabble.com/RabbitMQ-Consumer-timeout-tp27590.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130625/3468600c/attachment.htm>


More information about the rabbitmq-discuss mailing list