codelipenghui commented on code in PR #16165:
URL: https://github.com/apache/pulsar/pull/16165#discussion_r927388872
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java:
##########
@@ -124,6 +124,19 @@ public class ClientConfigurationData implements
Serializable, Cloneable {
)
private int connectionsPerBroker = 1;
+ @ApiModelProperty(
+ name = "connectionMaxIdleSeconds",
+ value = "Release the connection if it is not used for more than
[connectionMaxIdleSeconds] seconds. "
+ + "If [connectionMaxIdleSeconds] < 0, disabled the
feature that auto release the idle connections"
+ )
+ private int connectionMaxIdleSeconds = 180;
+
+ @ApiModelProperty(
+ name = "connectionIdleDetectionIntervalSeconds",
+ value = "How often check idle connections"
+ )
+ private int connectionIdleDetectionIntervalSeconds = 60;
Review Comment:
The `connectionMaxIdleSeconds` should always >=
`connectionIdleDetectionIntervalSeconds`? and is it able to remove this
configuration? Instead, we can have an interval second based on the
`connectionMaxIdleSeconds` to simplify the configuration.
##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ClientBuilder.java:
##########
@@ -566,4 +572,9 @@ ClientBuilder authentication(String authPluginClassName,
Map<String, String> aut
* @return
*/
ClientBuilder socks5ProxyPassword(String socks5ProxyPassword);
+
+ /**
+ * Disable The "auto release useless connections" feature.
+ */
+ ClientBuilder disabledAutoReleaseUselessConnections();
Review Comment:
Can we only use `connectionMaxIdleSeconds`? -1 means the auto release is
disabled.
--
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]