On 18/12/2019 12:32, Gordon Sim wrote:
On 18/12/2019 10:42 am, Toralf Lund wrote:
On 18/12/2019 10:40, Gordon Sim wrote:
On 18/12/2019 8:45 am, Toralf Lund wrote:
I don't see any signs of connection errors or explicit reopens but
automatic reconnect with a limit has been enabled; the following
connect options are used
connection.setOption("reconnect", true);
connection.setOption("reconnect_limit", 0);
(I believe this means trying reconnect once, as "reconnect_limit"
specifies retries after an initial attempt.)
I believe a reconnect_limit of 0 will reconnect without any limit.
If you want to only reconnect once, you would specify a value of 1.
However that would I believe be reset every time it does
successfully reconnect.
I've assumed the following constructs in
ConnectionImpl::ConnectionImpl() mean that a value of 1 actually
gives 2 attempts:
for (double i = minReconnectInterval; !tryConnect(); i =
std::min(i*2, maxReconnectInterval)) {
[ ... ]
if (limit >= 0 && retries++ >= limit) {
throw qpid::messaging::TransportFailure("Failed to
connect within reconnect limit");
}
[ ... ]
}
QPID_LOG(debug, "Connection successful, urls=" << asString(urls));
retries = 0;
(Notice how there is one tryConnect() before anything is checked, and
that limit check has >= and *post" increment of "retries".) But
perhaps I read that the wrong way?
No, you are right. What level of logging do you have on the client
side? Info level would have 'trying to connect' and 'connected to'
messages.
I currently only have "error+" logging. It might be possible to restart
with a different level.
The heartbeat firing logs only at debug level unfortunately from what
I can see.
Is there anything in your code that could be opening connections?
It actually has
if(!connection.isOpen()) {
Util::debug(1, "Open AMQP connection...");
try {
connection.open();
[ ... ]
in a function that's executed periodically, but I see only one instance
of the "Open AMQP connection..." message in my logs. (Util::debug() is
an in-house logging function, which is in this case expected to write
the given strings to a certain log file.)
I can't think of anything else that might open connections.
- Toralf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org