Gordon,

Thanks for the response and the clarification. With the sender code recompiled in, it all works as you state. I was just expecting a bit more from the I/O thread with regards to reconnecting without any other access to the messaging API.

I tried the same block of code, but with a Receiver undertaking a timed fetch, and that worked as well.

Thanks once again.

Clive

On 03/09/2012 09:48, Gordon Sim wrote:
On 09/01/2012 04:39 PM, CLIVE wrote:
I have been creating a producer client using qpid 0.14 (running 64bit
CENTOS 6.2) and I have encountered some unexpected behavior that I
wondered if someone could shed some light on.

The code shown below connects to a broker and then sends messages on a
exchange topic called foo with a subject of bar (this was commented out
to simplify the test) .

Question: are you saying that the client did not reconnect even when the send was enabled? That I would not expect.

With the send commented out, the inner loop doesn't do anything with the connection. In the current implementation, the application thread is the one that will actually drive reconnection. So if you don't make a call, then the library doesn't failover.

This is not the ideal implementation. It was done that way mainly to reuse the older client API as much as possible. The thread(s) started by the library to do the IO do(es) not have sufficient context to do the reconnect. I expect the upcoming AMQP 1.0 based implementation to be able to do better here.

However, as soon as you try to do something (e.g. send a message, fetch a message, get the next receiver for which a message is available etc), that *should* trigger reconnect (which with your settings would fail after 30 seconds of trying, resulting in an exception that would put you back into the outer loop).

If the broker is not up then everything works
find and the client will loop around until the broker becomes available
and it can then start sending its messages.

But if the client is connected to the broker and I kill the broker (to
simulate a broker crash) and then restart the broker several minutes
later, the client NEVER reconnects. All I see is a "warning connection
closed message" being reported by the client and the output from my loop
every 10 seconds.

That is the case even if you are sending message?


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to