[rabbitmq-discuss] log with rabbitmq-client

Tim Watson tim at rabbitmq.com
Fri Jan 11 21:08:07 GMT 2013


Hi

On 11 Jan 2013, at 11:08, raise-0 wrote:

> Sorry,Tim, It is my problem that make such unclear question.
> 

That's ok, I just wanted to press you for a bit more information. :)

> I can not get more message, log4j loglevel is debug, and still no exception logged.

RabbitMQ's java client does not use any logging library.

>  I restarted my applications again and again and want to get some log from rabbmit-java-client,but got none.

No indeed - there are no calls to log4j, logback, commons-logging, slf4j or even java.util.logging APIs in the client library. 

> If it is the application's problem, why my app can get message in early days? What i have done is just restart, no other change.

If you restarted the broker, what do you think happens to the sockets that the broker held open to communicate with your application? They've been closed and the connection between client and broker has been removed. How do you expect the client to receive messages if the connection is dropped? It can't, and of course because it is a consumer there is no 'indication' that the connection drops until the operating system decides to set an error code on the socket. If you want to be notified of this then you should register a ShutdownListener on the connection or channel: see http://www.rabbitmq.com/api-guide.html#shutdown for details.

> If it is the rabbitmq's problem, why other application and queue is running whithout any problem ?
> 

I have no idea, because this is the first you've mentioned 'other application's in this thread. I could offer some guesses, but I'd need more details on these other applications first.

> At last, I killed the rabbitmq-server process, restart it , and also restart my application again, erverything goes fine. So confused.
> 

It is that second step that fixed your problem ..

> restart my application again

.. because this forces the application to re-establish the network connection to the broker. If you do not manually (or in your code) re-establish the network connection that is broken when the server is stopped or restarted, then it will not magically happen. Unless you're using spring which has some support for re-connecting as I mentioned earlier in the thread.

> My question is , Is rabbitmq-java-client supports any logging compoments?
> 

I'm assuming that you mean "does the rabbitmq-java-client log any debugging information using log4j or some such" and the answer is no - the client library is not tied to any particular logging framework or API.

HTH

Cheers,
Tim




More information about the rabbitmq-discuss mailing list