SimpleAmqpClient
SimpleAmqpClient copied to clipboard
Client Hangs if the RabbitMQ Broker Service is not running
Hi there,
I am using the SimpleAmqpClient-2.4 working against rabbitmq-server-3.2.4-1 coming with Ubuntu-14.04. I found out that if the rabbitmq-server service is not running (ie, service rabbitmq-server stop), my client would hang forever instead of returning an error.
I tried a similar test using the go client (https://github.com/streadway/amqp) and it failed properly.
Is that a bug of the SimpleAmqpClient library?
Thanks, Shi
I realized in the rabbitmq-c library, there are two functions
- amqp_socket_open()
- amqp_socket_open_noblock()
and it seems that the SimpleAmqpClient is only using the first one,thus no timeout.
My questions are
- Is this why our code is blocking?
- Can we offer a choice to specify timeout in the future?
Thank you, Shi
What version of rabbitmq-c are you using?
We are using the rabbitmq-c version 0.7.1.
There was a bug in v0.7.1 that causes hangs like that, could you try running it with v0.8.0 and see if the issue is still there?
OK. I will give that a try. Thank you for the help.