On 19/03/2019 22:07, Gordon Sim wrote:
On 19/03/2019 1:09 pm, Toralf Lund wrote:
CouldĀ that fit with what I'm seeing? Is there a chance that
Connection::isOpen() returns false after an error, yet the connection
isn't really released? How should I detect and handle that situation?
I'm not sure what you mean by 'really released'. The isOpen() returns
true if the AMQP connection is currently active, false otherwise.
The question is, when the connection is automatically closed on error,
is everything fully closed down in the same way as when calling
Connection::close()?
I've always assumed that close() would shut down all sessions and their
senders and receivers, but perhaps that's not the case?
I suspect what may be happening is that when you open the same
connection that has been closed for some reason, if there were
previous sessions and consumers on it, those are recreated. If you
don't want that you can create a new connection instance before
opening it.
So closing does not make the existing sessions go away?
Actually, perhaps I've misunderstood the first sentence of the close()
documentation;
Closes a connection and all sessions associated with it. An opened
connection must be closed before the last handle is allowed to go
out of scope.
I've taken this to mean that I should create new sessions using
createSession() if I opened the connection again. Perhaps that's not the
case? Or is the morale of the story that I really ought not to call
open() a 2nd time? I notice that there is now also a reconnect(), but I
don't believe such a method existed at the time my application was written.
Thanks,
- Toralf
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]