|
pulsar-client-cpp
|
Public Types | |
| enum | ProxyProtocol : uint8_t { SNI = 0 } |
Public Member Functions | |
| ClientConfiguration (const ClientConfiguration &) | |
| ClientConfiguration & | operator= (const ClientConfiguration &) |
| ClientConfiguration & | setMemoryLimit (uint64_t memoryLimitBytes) |
| uint64_t | getMemoryLimit () const |
| ClientConfiguration & | setConnectionsPerBroker (int connectionsPerBroker) |
| int | getConnectionsPerBroker () const |
| ClientConfiguration & | setAuth (const AuthenticationPtr &authentication) |
| Authentication & | getAuth () const |
| ClientConfiguration & | setOperationTimeoutSeconds (int timeout) |
| int | getOperationTimeoutSeconds () const |
| ClientConfiguration & | setIOThreads (int threads) |
| int | getIOThreads () const |
| ClientConfiguration & | setMessageListenerThreads (int threads) |
| int | getMessageListenerThreads () const |
| ClientConfiguration & | setConcurrentLookupRequest (int concurrentLookupRequest) |
| int | getConcurrentLookupRequest () const |
| ClientConfiguration & | setMaxLookupRedirects (int maxLookupRedirects) |
| int | getMaxLookupRedirects () const |
| ClientConfiguration & | setInitialBackoffIntervalMs (int initialBackoffIntervalMs) |
| int | getInitialBackoffIntervalMs () const |
| ClientConfiguration & | setMaxBackoffIntervalMs (int maxBackoffIntervalMs) |
| int | getMaxBackoffIntervalMs () const |
| ClientConfiguration & | setLogger (LoggerFactory *loggerFactory) |
| ClientConfiguration & | setUseTls (bool useTls) |
| bool | isUseTls () const |
| ClientConfiguration & | setTlsPrivateKeyFilePath (const std::string &tlsKeyFilePath) |
| const std::string & | getTlsPrivateKeyFilePath () const |
| ClientConfiguration & | setTlsCertificateFilePath (const std::string &tlsCertificateFilePath) |
| const std::string & | getTlsCertificateFilePath () const |
| ClientConfiguration & | setTlsTrustCertsFilePath (const std::string &tlsTrustCertsFilePath) |
| const std::string & | getTlsTrustCertsFilePath () const |
| ClientConfiguration & | setTlsAllowInsecureConnection (bool allowInsecure) |
| bool | isTlsAllowInsecureConnection () const |
| ClientConfiguration & | setValidateHostName (bool validateHostName) |
| bool | isValidateHostName () const |
| ClientConfiguration & | setListenerName (const std::string &listenerName) |
| const std::string & | getListenerName () const |
| ClientConfiguration & | setStatsIntervalInSeconds (const unsigned int &) |
| const unsigned int & | getStatsIntervalInSeconds () const |
| ClientConfiguration & | setPartititionsUpdateInterval (unsigned int intervalInSeconds) |
| unsigned int | getPartitionsUpdateInterval () const |
| ClientConfiguration & | setConnectionTimeout (int timeoutMs) |
| ClientConfiguration & | setProxyServiceUrl (const std::string &proxyServiceUrl) |
| const std::string & | getProxyServiceUrl () const |
| ClientConfiguration & | setProxyProtocol (ProxyProtocol proxyProtocol) |
| ProxyProtocol | getProxyProtocol () const |
| int | getConnectionTimeout () const |
| ClientConfiguration & | setKeepAliveIntervalInSeconds (unsigned int keepAliveIntervalInSeconds) |
| unsigned int | getKeepAliveIntervalInSeconds () const |
Friends | |
| class | ClientImpl |
| class | PulsarWrapper |
| Authentication & pulsar::ClientConfiguration::getAuth | ( | ) | const |
| int pulsar::ClientConfiguration::getConcurrentLookupRequest | ( | ) | const |
| int pulsar::ClientConfiguration::getConnectionsPerBroker | ( | ) | const |
| int pulsar::ClientConfiguration::getConnectionTimeout | ( | ) | const |
The getter associated with setConnectionTimeout().
| int pulsar::ClientConfiguration::getInitialBackoffIntervalMs | ( | ) | const |
| int pulsar::ClientConfiguration::getIOThreads | ( | ) | const |
| unsigned int pulsar::ClientConfiguration::getKeepAliveIntervalInSeconds | ( | ) | const |
The getter associated with setKeepAliveIntervalInSeconds().
| const std::string & pulsar::ClientConfiguration::getListenerName | ( | ) | const |
| int pulsar::ClientConfiguration::getMaxBackoffIntervalMs | ( | ) | const |
| int pulsar::ClientConfiguration::getMaxLookupRedirects | ( | ) | const |
| uint64_t pulsar::ClientConfiguration::getMemoryLimit | ( | ) | const |
| int pulsar::ClientConfiguration::getMessageListenerThreads | ( | ) | const |
| int pulsar::ClientConfiguration::getOperationTimeoutSeconds | ( | ) | const |
| unsigned int pulsar::ClientConfiguration::getPartitionsUpdateInterval | ( | ) | const |
Get partitions update interval in seconds.
| const unsigned int & pulsar::ClientConfiguration::getStatsIntervalInSeconds | ( | ) | const |
| const std::string & pulsar::ClientConfiguration::getTlsCertificateFilePath | ( | ) | const |
| const std::string & pulsar::ClientConfiguration::getTlsPrivateKeyFilePath | ( | ) | const |
| const std::string & pulsar::ClientConfiguration::getTlsTrustCertsFilePath | ( | ) | const |
| bool pulsar::ClientConfiguration::isTlsAllowInsecureConnection | ( | ) | const |
| bool pulsar::ClientConfiguration::isUseTls | ( | ) | const |
| bool pulsar::ClientConfiguration::isValidateHostName | ( | ) | const |
| ClientConfiguration & pulsar::ClientConfiguration::setAuth | ( | const AuthenticationPtr & | authentication | ) |
Set the authentication method to be used with the broker
| authentication | the authentication data to use |
| ClientConfiguration & pulsar::ClientConfiguration::setConcurrentLookupRequest | ( | int | concurrentLookupRequest | ) |
Number of concurrent lookup-requests allowed on each broker-connection to prevent overload on broker. (default: 50000) It should be configured with higher value only in case of it requires to produce/subscribe on thousands of topic using created PulsarClient
| concurrentLookupRequest |
| ClientConfiguration & pulsar::ClientConfiguration::setConnectionsPerBroker | ( | int | connectionsPerBroker | ) |
Sets the max number of connection that the client library will open to a single broker. 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) |
| ClientConfiguration & pulsar::ClientConfiguration::setConnectionTimeout | ( | int | timeoutMs | ) |
Set the duration of time to wait for a connection to a broker to be established. If the duration passes without a response from the broker, the connection attempt is dropped.
Default: 10000
| timeoutMs | the duration in milliseconds |
| ClientConfiguration & pulsar::ClientConfiguration::setInitialBackoffIntervalMs | ( | int | initialBackoffIntervalMs | ) |
Initial backoff interval in milliseconds. (default: 100)
| initialBackoffIntervalMs |
| ClientConfiguration & pulsar::ClientConfiguration::setIOThreads | ( | int | threads | ) |
Set the number of IO threads to be used by the Pulsar client. Default is 1 thread.
| threads | number of threads |
| ClientConfiguration & pulsar::ClientConfiguration::setKeepAliveIntervalInSeconds | ( | unsigned int | keepAliveIntervalInSeconds | ) |
Set keep alive interval for each client-broker-connection. (default: 30 seconds).
| keepAliveIntervalInSeconds |
| ClientConfiguration & pulsar::ClientConfiguration::setListenerName | ( | const std::string & | listenerName | ) |
Configure the listener name that the broker returns the corresponding advertisedListener.
| name | the listener name |
| ClientConfiguration & pulsar::ClientConfiguration::setLogger | ( | LoggerFactory * | loggerFactory | ) |
Configure a custom logger backend to route of Pulsar client library to a different logger implementation.
By default, log messages are printed on standard output.
When passed in, the configuration takes ownership of the loggerFactory object. The logger factory can only be set once per process. Any subsequent calls to set the logger factory will have no effect, though the logger factory object will be cleaned up.
| ClientConfiguration & pulsar::ClientConfiguration::setMaxBackoffIntervalMs | ( | int | maxBackoffIntervalMs | ) |
Max backoff interval in milliseconds. (default: 60000)
| maxBackoffIntervalMs |
| ClientConfiguration & pulsar::ClientConfiguration::setMaxLookupRedirects | ( | int | maxLookupRedirects | ) |
Max number of lookup redirection allowed on each look request to prevent overload on broker. (default: 20)
| maxLookupRedirects |
| ClientConfiguration & pulsar::ClientConfiguration::setMemoryLimit | ( | uint64_t | memoryLimitBytes | ) |
Configure a limit on the amount of memory that will be allocated by this client instance. Setting this to 0 will disable the limit. By default this is disabled.
| memoryLimitBytes | the memory limit |
| ClientConfiguration & pulsar::ClientConfiguration::setMessageListenerThreads | ( | int | threads | ) |
Set the number of threads to be used by the Pulsar client when delivering messages through message listener. Default is 1 thread per Pulsar client.
If using more than 1 thread, messages for distinct MessageListener will be delivered in different threads, however a single MessageListener will always be assigned to the same thread.
| threads | number of threads |
| ClientConfiguration & pulsar::ClientConfiguration::setOperationTimeoutSeconds | ( | int | timeout | ) |
Set timeout on client operations (subscribe, create producer, close, unsubscribe) Default is 30 seconds.
| timeout | the timeout after which the operation will be considered as failed |
| ClientConfiguration & pulsar::ClientConfiguration::setPartititionsUpdateInterval | ( | unsigned int | intervalInSeconds | ) |
Set partitions update interval in seconds. If a partitioned topic is produced or subscribed and intervalInSeconds is not 0, every intervalInSeconds seconds the partition number will be retrieved by sending lookup requests. If partition number has been increased, more producer/consumer of increased partitions will be created. Default is 60 seconds.
| intervalInSeconds | the seconds between two lookup request for partitioned topic's metadata |
| ClientConfiguration & pulsar::ClientConfiguration::setProxyProtocol | ( | ProxyProtocol | proxyProtocol | ) |
Set appropriate proxy-protocol along with proxy-service url. Currently Pulsar supports SNI proxy routing.
SNI routing: https://docs.trafficserver.apache.org/en/latest/admin-guide/layer-4-routing.en.html#sni-routing.
| proxyProtocol | possible options (SNI) |
| ClientConfiguration & pulsar::ClientConfiguration::setProxyServiceUrl | ( | const std::string & | proxyServiceUrl | ) |
Set proxy-service url when client would like to connect to broker via proxy. Client must configure both proxyServiceUrl and appropriate proxyProtocol.
Example: pulsar+ssl://ats-proxy.example.com:4443
| proxyServiceUrl | proxy url to connect with broker |
| ClientConfiguration & pulsar::ClientConfiguration::setStatsIntervalInSeconds | ( | const unsigned int & | ) |
Initialize stats interval in seconds. Stats are printed and reset after every statsIntervalInSeconds.
Default: 600
Set to 0 means disabling stats collection.
| ClientConfiguration & pulsar::ClientConfiguration::setTlsAllowInsecureConnection | ( | bool | allowInsecure | ) |
Configure whether the Pulsar client accepts untrusted TLS certificates from brokers.
The default value is false.
| tlsAllowInsecureConnection |
| ClientConfiguration & pulsar::ClientConfiguration::setTlsCertificateFilePath | ( | const std::string & | tlsCertificateFilePath | ) |
Set the path to the TLS certificate file.
| tlsCertificateFilePath |
| ClientConfiguration & pulsar::ClientConfiguration::setTlsPrivateKeyFilePath | ( | const std::string & | tlsKeyFilePath | ) |
Set the path to the TLS private key file.
| tlsPrivateKeyFilePath |
| ClientConfiguration & pulsar::ClientConfiguration::setTlsTrustCertsFilePath | ( | const std::string & | tlsTrustCertsFilePath | ) |
Set the path to the trusted TLS certificate file.
| tlsTrustCertsFilePath |
| ClientConfiguration & pulsar::ClientConfiguration::setUseTls | ( | bool | useTls | ) |
Configure whether to use the TLS encryption on the connections.
The default value is false.
| useTls |
| ClientConfiguration & pulsar::ClientConfiguration::setValidateHostName | ( | bool | validateHostName | ) |
Configure whether it allows validating hostname verification when a client connects to a broker over TLS.
It validates the incoming x509 certificate and matches the provided hostname (CN/SAN) with the expected broker's hostname. It follows the server identity hostname verification in RFC 2818.
The default value is false.
| validateHostName | whether to enable the TLS hostname verification |