[rabbitmq-discuss] log with rabbitmq-client

Tim Watson tim at rabbitmq.com
Fri Jan 11 10:23:39 GMT 2013


On 11 Jan 2013, at 05:36, raise-0 wrote:

>  I came across one issue yesterday, and still not resolved now.
> Server: CentOS 6.3 x64, RabbitMQ Server v2.8.7
> Client:  CentOS 6.3 x64, RabbitMQ Java Client v2.8.7 Spring AMQP v1.1.3
> Problem:
> There is one queue with one million message, when i start the client application, the client application can not get any message, from the web admin page, I saw no consumer connection to this queue. The client application is nothing change before restart. I tried to log debug message from the rabbitmq-java-client, but I found it not depend on any log compoment. Before restart, the message can be consumered, but stoped with no error message logged. I was confused. Now, my client application can not start, with no error message logged.

It's very unclear what you're asking here and you've given us almost nothing to go on, so it's quite hard to suggest where to start. First you say that when starting the client you 'can not get any message', then later on you say the 'client application is nothing change [sic] before restart' - does this mean that you've restarted the broker whilst the client is still running? The RabbitMQ java client does not automatically re-connect after a broker restarts (thereby terminating the connection), although spring AMQP *may* offer some support for this - see http://forum.springsource.org/showthread.php?111170-rabbitmq-Retry-Reconnection-policy.

'Now, my client application can not start' - this is a different issue from not being able to consume messages after a restart.

> Any one know why and how to resolve it ?

If you're dealing with a client that *was* connected before the broker was restarted, then your client will have lost its connection to the broker. The client will need to re-connect to the broker, and you will need to write the code to handle that unless you're using some external library to do it for you.

For the latter problem, viz 'my client application can not start' the answer is "it depends". What do you mean by "cannot start" - the fact there is no logging in the client is irrelevant to some extent. You *must* know which branch of your code attempts to establish the connection, so what is not happening when the client starts that you were expecting to happen? Is there an exception, or does the code block indefinitely, or do small gremlins climb out of the server and start attacking people!? The more information you give us, the better we'll be able to help you ok! ;-)


More information about the rabbitmq-discuss mailing list