[rabbitmq-discuss] Why is the "select" always getting timed out in consumer?
alan.antonuk at gmail.com
Fri Dec 13 15:43:06 GMT 2013
The problem with your above code is that you've put the socket descriptor
in non-blocking mode and rabbitmq-c doesn't expect this, so when it tries
to recv() it gets a error it doesn't understand.
Instead of using select() directly, I'd suggest using a higher-level
non-blocking API such as
wait for a message with a time-out. An example of how to use this API can
be found in the
On Fri, Dec 13, 2013 at 7:29 AM, kingsmasher1 <raj.kumar.sanpui at gmail.com>wrote:
> We are actually using amqp_basic_consume( ).
> I see the difference between them:
> Thus, to check indeed there are any messages in the queue, i will have to
> keep on calling basic.get in a loop, that's as good as a blocking call
> [Regarding your earlier reply about select( ), the file descriptor becomes
> readable when, if there are any messages in the queue, right?]
> The best is:
> Do we have any API which can just check how many (or if there is any)
> message in the queue?
> View this message in context:
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss