ptupitsyn commented on a change in pull request #9863:
URL: https://github.com/apache/ignite/pull/9863#discussion_r822406279
##########
File path:
modules/core/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java
##########
@@ -678,4 +684,68 @@ public ClientConfiguration
setAsyncContinuationExecutor(Executor asyncContinuati
return this;
}
+
+ /**
+ * Gets a value indicating whether heartbeats are enabled.
+ * <p />
+ * When thin client connection is idle (no operations are performed),
heartbeat messages are sent periodically
+ * to keep the connection alive and detect potential half-open state.
+ * <p />
+ * See also {@link ClientConfiguration#heartbeatInterval}.
+ *
+ * @return Whether heartbeats are enabled.
+ */
+ public boolean isHeartbeatEnabled() {
+ return heartbeatEnabled;
+ }
+
+ /**
+ * Sets a value indicating whether heartbeats are enabled.
+ * <p />
+ * When thin client connection is idle (no operations are performed),
heartbeat messages are sent periodically
+ * to keep the connection alive and detect potential half-open state.
+ * <p />
+ * See also {@link ClientConfiguration#heartbeatInterval}.
+ *
+ * @param heartbeatEnabled Whether to enable heartbeats.
+ * @return {@code this} for chaining.
+ */
+ public ClientConfiguration setHeartbeatEnabled(boolean heartbeatEnabled) {
+ this.heartbeatEnabled = heartbeatEnabled;
+
+ return this;
+ }
+
+ /**
+ * Gets the heartbeat message interval, in milliseconds. Default is
<code>30_000</code>.
+ * <p />
+ * When server-side <see cref="ClientConnectorConfiguration.IdleTimeout"/>
is not zero, effective heartbeat
+ * interval is set to <code>min(heartbeatInterval, idleTimeout / 3)</code>.
+ * <p />
+ * When thin client connection is idle (no operations are performed),
heartbeat messages are sent periodically
+ * to keep the connection alive and detect potential half-open state. *
+ *
+ * @return Heartbeat interval.
+ */
+ public long getHeartbeatInterval() {
+ return heartbeatInterval;
+ }
+
+ /**
+ * Sets the heartbeat message interval, in milliseconds. Default is
<code>30_000</code>.
+ * <p />
+ * When server-side <see cref="ClientConnectorConfiguration.IdleTimeout"/>
is not zero, effective heartbeat
Review comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]