Quantcast

Client reconnect

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Client reconnect

Matthew
I have a case where occasionally the link between the client and SwiftMQ HA router drops very briefly (we're looking into this separately but it raised a valid concern).

The client correctly notices this and we see the following in the debug log:

Thu Oct 13 09:08:06 UTC 2016 com.swiftmq.jms.v750.ConnectionImpl@46215c85: decrementing keepalive counter to 4
Thu Oct 13 09:09:06 UTC 2016 com.swiftmq.jms.v750.ConnectionImpl@46215c85: decrementing keepalive counter to 3
Thu Oct 13 09:10:06 UTC 2016 com.swiftmq.jms.v750.ConnectionImpl@46215c85: decrementing keepalive counter to 2
Thu Oct 13 09:11:06 UTC 2016 com.swiftmq.jms.v750.ConnectionImpl@46215c85: decrementing keepalive counter to 1
Thu Oct 13 09:12:06 UTC 2016 com.swiftmq.jms.v750.ConnectionImpl@46215c85: decrementing keepalive counter to 0
Thu Oct 13 09:12:06 UTC 2016 com.swiftmq.jms.v750.ConnectionImpl@46215c85: keepalive counter reaches 0, invalidating connection!

However, we know that the network itself is back up within milliseconds so I wondered if there is anything we can do to re-establish that connection while the keep alive counter is slowly and inevitably counting to zero.

In addition, when the counter does reach zero, the client appears to assume that the primary instance has failed and attempts a connection to the Standby instance

Thu Oct 13 09:12:06 UTC 2016 [Connector, rc=com.swiftmq.jms.v750.ConnectionImpl@46215c85], visit, po=[POReconnect, recreatableConnection=com.swiftmq.jms.v750.ConnectionImpl@46215c85] ... [recreateStarted=false, reconnectInProgress=false]
Thu Oct 13 09:12:06 UTC 2016 [Reconnector, com.swiftmq.jms.v750.ConnectionImpl@46215c85], invalidateConnection, active=[BlockingConnection, socket=Socket[addr=/INSTANCE_1_IP,port=5004,localport=45864]]
Thu Oct 13 09:12:06 UTC 2016 [Reconnector, com.swiftmq.jms.v750.ConnectionImpl@46215c85], getConnection ...
Thu Oct 13 09:12:06 UTC 2016 [Reconnector, com.swiftmq.jms.v750.ConnectionImpl@46215c85], nRetries=-1, waiting 10000 ms ...
Thu Oct 13 09:12:16 UTC 2016 [Reconnector, com.swiftmq.jms.v750.ConnectionImpl@46215c85], nRetries=-1, attempt to create connection to: [ServerEntry, hostname=INSTANCE_2_IP, port=5004]

Which also inevitably fails as there is nothing wrong with the Active instance

It then recovers but has spent around 7 or 8 minutes doing so.

The server is running v9.6.0 and the client v9.2.1.  I haven't seen anything in the release notes that suggested upgrading the client to v9.6.0 would help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Client reconnect

IIT Software
Administrator
The keep alive counter is always initialized with 5 and counts down each on the keep alive interval. This is what you can change in the JMS listener config and so influence the reconnect time.

Sure, the client will try to connect to the standby instance first after the connection fails to the active.
Loading...