Class ConnectionPolicy
java.lang.Object
org.apache.pulsar.client.api.v5.config.ConnectionPolicy
Connection-level settings for the Pulsar client.
Groups TCP connection timeout, connection pool sizing, keep-alive, idle timeout, TCP no-delay, I/O and callback threading, and proxy configuration.
Construct via builder().
-
Nested Class Summary
Nested Classes -
Method Summary
-
Method Details
-
connectionTimeout
- Returns:
- the maximum duration to wait for a TCP connection to a broker
-
connectionsPerBroker
public int connectionsPerBroker()- Returns:
- the number of TCP connections maintained per broker
-
enableTcpNoDelay
public boolean enableTcpNoDelay()- Returns:
- whether TCP no-delay (Nagle disabled) is enabled
-
keepAliveInterval
- Returns:
- the interval between TCP keep-alive probes
-
connectionMaxIdleTime
- Returns:
- the maximum idle duration before a connection is closed
-
ioThreads
public int ioThreads()- Returns:
- the number of I/O threads
-
callbackThreads
public int callbackThreads()- Returns:
- the number of callback threads
-
proxyServiceUrl
- Returns:
- the proxy service URL, or
nullif no proxy is configured
-
proxyProtocol
- Returns:
- the proxy protocol, or
nullif no proxy is configured
-
connectionBackoff
- Returns:
- the broker-reconnection backoff policy
-
builder
- Returns:
- a new builder for constructing a
ConnectionPolicy
-