PulsarClient.builder() to construct and configure a new PulsarClient instance@Deprecated public class ClientConfiguration extends Object implements Serializable
| Constructor and Description |
|---|
ClientConfiguration()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
Authentication |
getAuthentication()
Deprecated.
|
int |
getConcurrentLookupRequest()
Deprecated.
Get configured total allowed concurrent lookup-request.
|
ClientConfigurationData |
getConfigurationData()
Deprecated.
|
int |
getConnectionsPerBroker()
Deprecated.
|
int |
getIoThreads()
Deprecated.
|
int |
getListenerThreads()
Deprecated.
|
int |
getMaxNumberOfRejectedRequestPerConnection()
Deprecated.
Get configured max number of reject-request in a time-frame (30 seconds) after which connection will be closed
|
long |
getOperationTimeoutMs()
Deprecated.
|
long |
getStatsIntervalSeconds()
Deprecated.
Stats will be activated with positive statsIntervalSeconds
|
String |
getTlsTrustCertsFilePath()
Deprecated.
|
boolean |
isTlsAllowInsecureConnection()
Deprecated.
|
boolean |
isTlsHostnameVerificationEnable()
Deprecated.
|
boolean |
isUseTcpNoDelay()
Deprecated.
|
boolean |
isUseTls()
Deprecated.
|
void |
setAuthentication(Authentication authentication)
Deprecated.
Set the authentication provider to use in the Pulsar client instance.
|
void |
setAuthentication(String authPluginClassName,
Map<String,String> authParams)
Deprecated.
Set the authentication provider to use in the Pulsar client instance.
|
void |
setAuthentication(String authPluginClassName,
String authParamsString)
Deprecated.
Set the authentication provider to use in the Pulsar client instance.
|
void |
setConcurrentLookupRequest(int concurrentLookupRequest)
Deprecated.
Number of concurrent lookup-requests allowed on each broker-connection to prevent overload on broker.
|
void |
setConnectionsPerBroker(int connectionsPerBroker)
Deprecated.
Sets the max number of connection that the client library will open to a single broker.
|
void |
setIoThreads(int numIoThreads)
Deprecated.
Set the number of threads to be used for handling connections to brokers (default: 1 thread)
|
void |
setListenerThreads(int numListenerThreads)
Deprecated.
Set the number of threads to be used for message listeners (default: 1 thread)
|
void |
setMaxNumberOfRejectedRequestPerConnection(int maxNumberOfRejectedRequestPerConnection)
Deprecated.
Set max number of broker-rejected requests in a certain time-frame (30 seconds) after which current connection
will be closed and client creates a new connection that give chance to connect a different broker (default:
50)
|
void |
setOperationTimeout(int operationTimeout,
TimeUnit unit)
Deprecated.
Set the operation timeout (default: 30 seconds)
|
ClientConfiguration |
setServiceUrl(String serviceUrl)
Deprecated.
|
void |
setStatsInterval(long statsInterval,
TimeUnit unit)
Deprecated.
Set the interval between each stat info (default: 60 seconds) Stats will be activated with positive
statsIntervalSeconds It should be set to at least 1 second
|
void |
setTlsAllowInsecureConnection(boolean tlsAllowInsecureConnection)
Deprecated.
Configure whether the Pulsar client accept untrusted TLS certificate from broker (default: false)
|
void |
setTlsHostnameVerificationEnable(boolean tlsHostnameVerificationEnable)
Deprecated.
It allows to validate hostname verification when client connects to broker over tls.
|
void |
setTlsTrustCertsFilePath(String tlsTrustCertsFilePath)
Deprecated.
Set the path to the trusted TLS certificate file
|
void |
setUseTcpNoDelay(boolean useTcpNoDelay)
Deprecated.
Configure whether to use TCP no-delay flag on the connection, to disable Nagle algorithm.
|
void |
setUseTls(boolean useTls)
Deprecated.
Configure whether to use TLS encryption on the connection (default: false)
|
public Authentication getAuthentication()
public void setAuthentication(Authentication authentication)
Example:
ClientConfiguration confData = new ClientConfiguration();
String authPluginClassName = "org.apache.pulsar.client.impl.auth.MyAuthentication";
String authParamsString = "key1:val1,key2:val2";
Authentication auth = AuthenticationFactory.create(authPluginClassName, authParamsString);
confData.setAuthentication(auth);
PulsarClient client = PulsarClient.create(serviceUrl, confData);
....
authentication - public void setAuthentication(String authPluginClassName, String authParamsString) throws PulsarClientException.UnsupportedAuthenticationException
Example:
ClientConfiguration confData = new ClientConfiguration();
String authPluginClassName = "org.apache.pulsar.client.impl.auth.MyAuthentication";
String authParamsString = "key1:val1,key2:val2";
confData.setAuthentication(authPluginClassName, authParamsString);
PulsarClient client = PulsarClient.create(serviceUrl, confData);
....
authPluginClassName - name of the Authentication-Plugin you want to useauthParamsString - string which represents parameters for the Authentication-Plugin, e.g., "key1:val1,key2:val2"PulsarClientException.UnsupportedAuthenticationException - failed to instantiate specified Authentication-Pluginpublic void setAuthentication(String authPluginClassName, Map<String,String> authParams) throws PulsarClientException.UnsupportedAuthenticationException
Example:
ClientConfiguration confData = new ClientConfiguration();
String authPluginClassName = "org.apache.pulsar.client.impl.auth.MyAuthentication";
Map authParams = new HashMap();
authParams.put("key1", "val1");
confData.setAuthentication(authPluginClassName, authParams);
PulsarClient client = PulsarClient.create(serviceUrl, confData);
....
authPluginClassName - name of the Authentication-Plugin you want to useauthParams - map which represents parameters for the Authentication-PluginPulsarClientException.UnsupportedAuthenticationException - failed to instantiate specified Authentication-Pluginpublic long getOperationTimeoutMs()
public void setOperationTimeout(int operationTimeout,
TimeUnit unit)
Producer-create, subscribe and unsubscribe operations will be retried until this interval, after which the operation will be marked as failed
operationTimeout - operation timeoutunit - time unit for operationTimeoutpublic int getIoThreads()
public void setIoThreads(int numIoThreads)
numIoThreads - public int getListenerThreads()
public void setListenerThreads(int numListenerThreads)
numListenerThreads - public int getConnectionsPerBroker()
public void setConnectionsPerBroker(int connectionsPerBroker)
By default, the connection pool will use a single connection for all the producers and consumers. Increasing this parameter may improve throughput when using many producers over a high latency connection.
connectionsPerBroker - max number of connections per broker (needs to be greater than 0)public boolean isUseTcpNoDelay()
public void setUseTcpNoDelay(boolean useTcpNoDelay)
No-delay features make sure packets are sent out on the network as soon as possible, and it's critical to achieve
low latency publishes. On the other hand, sending out a huge number of small packets might limit the overall
throughput, so if latency is not a concern, it's advisable to set the useTcpNoDelay flag to false.
Default value is true
useTcpNoDelay - public boolean isUseTls()
public void setUseTls(boolean useTls)
useTls - public String getTlsTrustCertsFilePath()
public void setTlsTrustCertsFilePath(String tlsTrustCertsFilePath)
tlsTrustCertsFilePath - public boolean isTlsAllowInsecureConnection()
public void setTlsAllowInsecureConnection(boolean tlsAllowInsecureConnection)
tlsAllowInsecureConnection - public long getStatsIntervalSeconds()
public void setStatsInterval(long statsInterval,
TimeUnit unit)
statsIntervalSeconds - the interval between each stat infounit - time unit for statsIntervalpublic int getConcurrentLookupRequest()
public void setConcurrentLookupRequest(int concurrentLookupRequest)
PulsarClientconcurrentLookupRequest - public int getMaxNumberOfRejectedRequestPerConnection()
public void setMaxNumberOfRejectedRequestPerConnection(int maxNumberOfRejectedRequestPerConnection)
maxNumberOfRejectedRequestPerConnection - public boolean isTlsHostnameVerificationEnable()
public void setTlsHostnameVerificationEnable(boolean tlsHostnameVerificationEnable)
tlsHostnameVerificationEnable - public ClientConfiguration setServiceUrl(String serviceUrl)
public ClientConfigurationData getConfigurationData()
Copyright © 2017–2018 Apache Software Foundation. All rights reserved.