You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2024/04/22 07:16:47 UTC
Re: [PR] [improve][client] Add maxConnectionsPerHost and connectionMaxIdleSeconds to PulsarAdminBuilder [pulsar]
lhotari commented on code in PR #22541:
URL: https://github.com/apache/pulsar/pull/22541#discussion_r1574241817
##########
pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/PulsarAdminBuilder.java:
##########
@@ -336,4 +336,30 @@ PulsarAdminBuilder authentication(String authPluginClassName, Map<String, String
* requests
*/
PulsarAdminBuilder acceptGzipCompression(boolean acceptGzipCompression);
+
+ /**
+ * Configures the maximum number of connections that the client library will establish with a single host.
+ * <p>
+ * By default, the connection pool maintains up to 16 connections to a single host. This method allows you to
+ * modify this default behavior and limit the number of connections.
+ * <p>
+ * This setting can be useful in scenarios where you want to limit the resources used by the client library,
+ * or control the level of parallelism for operations so that a single client does not overwhelm
+ * the Pulsar cluster with too many concurrent connections.
+ *
+ * @param connectionsPerHost the maximum number of connections to establish per host. Set to <= 0 to disable
+ * the limit.
+ * @return the PulsarAdminBuilder instance, allowing for method chaining
+ */
+ PulsarAdminBuilder connectionsPerHost(int connectionsPerHost);
Review Comment:
makes sense. renamed
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org