Setting Client Keepalives

The APIs have built-in Keepalive mechanisms that are used to monitor the status of client connections. Keepalive messages are sent to the event broker over those connections at timed intervals (the minimum valid value is 50 milliseconds). If a response is not received after the maximum number of consecutive Keepalive messages are sent, the API closes the connection. At this point, the client can be reconnected.

Using Keepalive and reconnects can be useful if, for example, an application receives messages infrequently and remains idle for most of the time.

To disable the use of Keepalives, set an interval value of 0.

Disabling Keepalives can sometimes delay activity switches that occur when active/active redundancy is used and can cause transient service disruptions.

To Set a Keepalive Interval

PubSub+ Messaging API Use

JCSMP

JCSMPChannelProperties.setKeepAliveIntervalInMillis(...)

Java RTO

SessionHandle.PROPERTIES.KEEP_ALIVE_INT_MS

C

SOLCLIENT_SESSION_PROP_KEEP_ALIVE_INT_MS

.NET

SessionProperties.KeepAliveIntervalInMsecs

JavaScript and Node.js

solace.SessionProperties.keepAliveIntervalInMsecs

To Set the Maximum Number of Keepalives To Send Without Receiving a Response

PubSub+ Messaging API Use

JCSMP

JCSMPChannelProperties.setKeepAliveLimit(...)

Java RTO

SessionHandle.PROPERTIES.KEEP_ALIVE_LIMIT

C

SOLCLIENT_SESSION_PROP_KEEP_ALIVE_LIMIT

.NET

SessionProperties.KeepAliveIntervalsLimit

Javascript and Node.js

solace.SessionProperties.keepAliveIntervalsLimit