diff --git a/static/api/cpp/3.6.x/_authentication_8h_source.html b/static/api/cpp/3.6.x/_authentication_8h_source.html new file mode 100644 index 000000000000..80c2d76e0989 --- /dev/null +++ b/static/api/cpp/3.6.x/_authentication_8h_source.html @@ -0,0 +1,450 @@ + + +
+ + + + +
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthAthenz, including all inherited members.
+AuthAthenz(AuthenticationDataPtr &) (defined in pulsar::AuthAthenz) | pulsar::AuthAthenz | |
authData_ (defined in pulsar::Authentication) | pulsar::Authentication | protected |
Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | protected |
create(ParamMap ¶ms) | pulsar::AuthAthenz | static |
create(const std::string &authParamsString) | pulsar::AuthAthenz | static |
getAuthData(AuthenticationDataPtr &authDataAthenz) | pulsar::AuthAthenz | virtual |
getAuthMethodName() const | pulsar::AuthAthenz | virtual |
parseDefaultFormatAuthParams(const std::string &authParamsString) | pulsar::Authentication | static |
~AuthAthenz() (defined in pulsar::AuthAthenz) | pulsar::AuthAthenz | |
~Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | virtual |
+ pulsar-client-cpp
+
+ |
+
#include <Authentication.h>
+Public Member Functions | |
+ | AuthAthenz (AuthenticationDataPtr &) |
const std::string | getAuthMethodName () const |
Result | getAuthData (AuthenticationDataPtr &authDataAthenz) |
Public Member Functions inherited from pulsar::Authentication |
+Static Public Member Functions | |
static AuthenticationPtr | create (ParamMap ¶ms) |
static AuthenticationPtr | create (const std::string &authParamsString) |
Static Public Member Functions inherited from pulsar::Authentication | |
static ParamMap | parseDefaultFormatAuthParams (const std::string &authParamsString) |
+Additional Inherited Members | |
Protected Member Functions inherited from pulsar::Authentication | |
Protected Attributes inherited from pulsar::Authentication | |
+AuthenticationDataPtr | authData_ |
Athenz implementation of Pulsar client authentication
+
+
|
+ +static | +
Create an AuthAthenz with an authentication parameter string
+ + +
+
|
+ +static | +
Create an AuthAthenz with a ParamMap
+The required parameter keys are “tenantDomain”, “tenantService”, “providerDomain”, “privateKey”, and “ztsUrl”
+params | the key-value to construct ZTS client |
+
|
+ +virtual | +
Get AuthenticationData from the current instance
+[out] | authDataAthenz | the shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance. |
Reimplemented from pulsar::Authentication.
+ +
+
|
+ +virtual | +
Implements pulsar::Authentication.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthBasic, including all inherited members.
+AuthBasic(AuthenticationDataPtr &) (defined in pulsar::AuthBasic) | pulsar::AuthBasic | explicit |
authData_ (defined in pulsar::Authentication) | pulsar::Authentication | protected |
Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | protected |
create(ParamMap ¶ms) | pulsar::AuthBasic | static |
create(const std::string &authParamsString) | pulsar::AuthBasic | static |
create(const std::string &username, const std::string &password) | pulsar::AuthBasic | static |
create(const std::string &username, const std::string &password, const std::string &method) | pulsar::AuthBasic | static |
getAuthData(AuthenticationDataPtr &authDataBasic) override | pulsar::AuthBasic | virtual |
getAuthMethodName() const override | pulsar::AuthBasic | virtual |
parseDefaultFormatAuthParams(const std::string &authParamsString) | pulsar::Authentication | static |
~AuthBasic() override (defined in pulsar::AuthBasic) | pulsar::AuthBasic | |
~Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | virtual |
+ pulsar-client-cpp
+
+ |
+
#include <Authentication.h>
+Public Member Functions | |
+ | AuthBasic (AuthenticationDataPtr &) |
const std::string | getAuthMethodName () const override |
Result | getAuthData (AuthenticationDataPtr &authDataBasic) override |
Public Member Functions inherited from pulsar::Authentication |
+Static Public Member Functions | |
static AuthenticationPtr | create (ParamMap ¶ms) |
static AuthenticationPtr | create (const std::string &authParamsString) |
static AuthenticationPtr | create (const std::string &username, const std::string &password) |
static AuthenticationPtr | create (const std::string &username, const std::string &password, const std::string &method) |
Static Public Member Functions inherited from pulsar::Authentication | |
static ParamMap | parseDefaultFormatAuthParams (const std::string &authParamsString) |
+Additional Inherited Members | |
Protected Member Functions inherited from pulsar::Authentication | |
Protected Attributes inherited from pulsar::Authentication | |
+AuthenticationDataPtr | authData_ |
Basic based implementation of Pulsar client authentication
+
+
|
+ +static | +
Create an AuthBasic with an authentication parameter string
+authParamsString | the JSON format string: {"username": "admin", "password": "123456"} |
+
|
+ +static | +
Create an AuthBasic with the required parameters
+ +
+
|
+ +static | +
Create an AuthBasic with the required parameters
+ +
+
|
+ +static | +
Create an AuthBasic with a ParamMap
+It is equal to create(params[“username”], params[“password”])
+ +
+
|
+ +overridevirtual | +
Get AuthenticationData from the current instance
+[out] | authDataBasic | the shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance. |
Reimplemented from pulsar::Authentication.
+ +
+
|
+ +overridevirtual | +
Implements pulsar::Authentication.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthFactory, including all inherited members.
+create(const std::string &pluginNameOrDynamicLibPath) | pulsar::AuthFactory | static |
create(const std::string &pluginNameOrDynamicLibPath, const std::string &authParamsString) | pulsar::AuthFactory | static |
create(const std::string &pluginNameOrDynamicLibPath, ParamMap ¶ms) | pulsar::AuthFactory | static |
Disabled() (defined in pulsar::AuthFactory) | pulsar::AuthFactory | static |
isShutdownHookRegistered_ (defined in pulsar::AuthFactory) | pulsar::AuthFactory | protectedstatic |
loadedLibrariesHandles_ (defined in pulsar::AuthFactory) | pulsar::AuthFactory | protectedstatic |
release_handles() (defined in pulsar::AuthFactory) | pulsar::AuthFactory | protectedstatic |
+ pulsar-client-cpp
+
+ |
+
#include <Authentication.h>
+Static Public Member Functions | |
+static AuthenticationPtr | Disabled () |
static AuthenticationPtr | create (const std::string &pluginNameOrDynamicLibPath) |
static AuthenticationPtr | create (const std::string &pluginNameOrDynamicLibPath, const std::string &authParamsString) |
static AuthenticationPtr | create (const std::string &pluginNameOrDynamicLibPath, ParamMap ¶ms) |
+Static Protected Member Functions | |
+static void | release_handles () |
+Static Protected Attributes | |
+static bool | isShutdownHookRegistered_ |
+static std::vector< void * > | loadedLibrariesHandles_ |
AuthFactory is used to create instances of Authentication class when configuring a Client instance. It loads the authentication from an external plugin.
+To use authentication methods that are internally supported, you should use AuthTls::create("my-cert.pem", "my-private.key")
or similar.
+
|
+ +static | +
Create an AuthenticationPtr with an empty ParamMap
+
+
|
+ +static | +
Create an AuthenticationPtr with a ParamMap that is converted from authParamsString
+
+
|
+ +static | +
Create an AuthenticationPtr
+When the first parameter represents the plugin name, the type of authentication can be one of the following:
pluginNameOrDynamicLibPath | the plugin name or the path or a dynamic library that contains the implementation of Authentication |
params | the ParamMap that is passed to Authentication::create method |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthOauth2, including all inherited members.
+authData_ (defined in pulsar::Authentication) | pulsar::Authentication | protected |
Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | protected |
AuthOauth2(ParamMap ¶ms) (defined in pulsar::AuthOauth2) | pulsar::AuthOauth2 | |
create(ParamMap ¶ms) | pulsar::AuthOauth2 | static |
create(const std::string &authParamsString) | pulsar::AuthOauth2 | static |
getAuthData(AuthenticationDataPtr &authDataOauth2) | pulsar::AuthOauth2 | virtual |
getAuthMethodName() const | pulsar::AuthOauth2 | virtual |
parseDefaultFormatAuthParams(const std::string &authParamsString) | pulsar::Authentication | static |
~Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | virtual |
~AuthOauth2() (defined in pulsar::AuthOauth2) | pulsar::AuthOauth2 |
+ pulsar-client-cpp
+
+ |
+
#include <Authentication.h>
+Public Member Functions | |
+ | AuthOauth2 (ParamMap ¶ms) |
const std::string | getAuthMethodName () const |
Result | getAuthData (AuthenticationDataPtr &authDataOauth2) |
Public Member Functions inherited from pulsar::Authentication |
+Static Public Member Functions | |
static AuthenticationPtr | create (ParamMap ¶ms) |
static AuthenticationPtr | create (const std::string &authParamsString) |
Static Public Member Functions inherited from pulsar::Authentication | |
static ParamMap | parseDefaultFormatAuthParams (const std::string &authParamsString) |
+Additional Inherited Members | |
Protected Member Functions inherited from pulsar::Authentication | |
Protected Attributes inherited from pulsar::Authentication | |
+AuthenticationDataPtr | authData_ |
Oauth2 based implementation of Pulsar client authentication. Passed in parameter would be like:
If passed in as std::string, it should be in Json format.
+
+
|
+ +static | +
Create an AuthOauth2 with an authentication parameter string
+ + +
+
|
+ +static | +
Create an AuthOauth2 with a ParamMap
+The required parameter keys are “issuer_url”, “private_key”, and “audience”
+parameters | the key-value to create OAuth 2.0 client credentials |
+
|
+ +virtual | +
Get AuthenticationData from the current instance
+[out] | authDataOauth2 | the shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance. |
Reimplemented from pulsar::Authentication.
+ +
+
|
+ +virtual | +
Implements pulsar::Authentication.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthTls, including all inherited members.
+authData_ (defined in pulsar::Authentication) | pulsar::Authentication | protected |
Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | protected |
AuthTls(AuthenticationDataPtr &) (defined in pulsar::AuthTls) | pulsar::AuthTls | |
create(ParamMap ¶ms) | pulsar::AuthTls | static |
create(const std::string &authParamsString) | pulsar::AuthTls | static |
create(const std::string &certificatePath, const std::string &privateKeyPath) | pulsar::AuthTls | static |
getAuthData(AuthenticationDataPtr &authDataTls) | pulsar::AuthTls | virtual |
getAuthMethodName() const | pulsar::AuthTls | virtual |
parseDefaultFormatAuthParams(const std::string &authParamsString) | pulsar::Authentication | static |
~Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | virtual |
~AuthTls() (defined in pulsar::AuthTls) | pulsar::AuthTls |
+ pulsar-client-cpp
+
+ |
+
#include <Authentication.h>
+Public Member Functions | |
+ | AuthTls (AuthenticationDataPtr &) |
const std::string | getAuthMethodName () const |
Result | getAuthData (AuthenticationDataPtr &authDataTls) |
Public Member Functions inherited from pulsar::Authentication |
+Static Public Member Functions | |
static AuthenticationPtr | create (ParamMap ¶ms) |
static AuthenticationPtr | create (const std::string &authParamsString) |
static AuthenticationPtr | create (const std::string &certificatePath, const std::string &privateKeyPath) |
Static Public Member Functions inherited from pulsar::Authentication | |
static ParamMap | parseDefaultFormatAuthParams (const std::string &authParamsString) |
+Additional Inherited Members | |
Protected Member Functions inherited from pulsar::Authentication | |
Protected Attributes inherited from pulsar::Authentication | |
+AuthenticationDataPtr | authData_ |
TLS implementation of Pulsar client authentication
+
+
|
+ +static | +
Create an AuthTls with an authentication parameter string
+ + +
+
|
+ +static | +
Create an AuthTls with the required parameters
+certificatePath | the file path for a client certificate |
privateKeyPath | the file path for a client private key |
+
|
+ +static | +
Create an AuthTls with a ParamMap
+It is equal to create(params[“tlsCertFile”], params[“tlsKeyFile”])
+ +
+
|
+ +virtual | +
Get AuthenticationData from the current instance
+[out] | authDataTls | the shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance. |
Reimplemented from pulsar::Authentication.
+ +
+
|
+ +virtual | +
Implements pulsar::Authentication.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthToken, including all inherited members.
+authData_ (defined in pulsar::Authentication) | pulsar::Authentication | protected |
Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | protected |
AuthToken(AuthenticationDataPtr &) (defined in pulsar::AuthToken) | pulsar::AuthToken | |
create(ParamMap ¶ms) | pulsar::AuthToken | static |
create(const std::string &authParamsString) | pulsar::AuthToken | static |
create(const TokenSupplier &tokenSupplier) | pulsar::AuthToken | static |
createWithToken(const std::string &token) | pulsar::AuthToken | static |
getAuthData(AuthenticationDataPtr &authDataToken) | pulsar::AuthToken | virtual |
getAuthMethodName() const | pulsar::AuthToken | virtual |
parseDefaultFormatAuthParams(const std::string &authParamsString) | pulsar::Authentication | static |
~Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | virtual |
~AuthToken() (defined in pulsar::AuthToken) | pulsar::AuthToken |
+ pulsar-client-cpp
+
+ |
+
#include <Authentication.h>
+Public Member Functions | |
+ | AuthToken (AuthenticationDataPtr &) |
const std::string | getAuthMethodName () const |
Result | getAuthData (AuthenticationDataPtr &authDataToken) |
Public Member Functions inherited from pulsar::Authentication |
+Static Public Member Functions | |
static AuthenticationPtr | create (ParamMap ¶ms) |
static AuthenticationPtr | create (const std::string &authParamsString) |
static AuthenticationPtr | createWithToken (const std::string &token) |
static AuthenticationPtr | create (const TokenSupplier &tokenSupplier) |
Static Public Member Functions inherited from pulsar::Authentication | |
static ParamMap | parseDefaultFormatAuthParams (const std::string &authParamsString) |
+Additional Inherited Members | |
Protected Member Functions inherited from pulsar::Authentication | |
Protected Attributes inherited from pulsar::Authentication | |
+AuthenticationDataPtr | authData_ |
Token based implementation of Pulsar client authentication
+
+
|
+ +static | +
Create an AuthToken with an authentication parameter string
+ + +
+
|
+ +static | +
Create an authentication provider for token based authentication
+tokenSupplier | a supplier of the client auth token |
+
|
+ +static | +
Create an AuthToken with a ParamMap
+parameters | it must contain a key-value, where key means how to get the token and value means the token source |
If the key is “token”, the value is the token
+If the key is “file”, the value is the file that contains the token
+If the key is “env”, the value is the environment variable whose value is the token
+Otherwise, a std::runtime_error
error is thrown.
+
|
+ +static | +
Create an authentication provider for token based authentication
+token | a string containing the auth token |
+
|
+ +virtual | +
Get AuthenticationData from the current instance
+[out] | authDataToken | the shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance. |
Reimplemented from pulsar::Authentication.
+ +
+
|
+ +virtual | +
Implements pulsar::Authentication.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Authentication, including all inherited members.
+authData_ (defined in pulsar::Authentication) | pulsar::Authentication | protected |
Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | protected |
ClientConfiguration (defined in pulsar::Authentication) | pulsar::Authentication | friend |
getAuthData(AuthenticationDataPtr &authDataContent) | pulsar::Authentication | inlinevirtual |
getAuthMethodName() const =0 | pulsar::Authentication | pure virtual |
parseDefaultFormatAuthParams(const std::string &authParamsString) | pulsar::Authentication | static |
~Authentication() (defined in pulsar::Authentication) | pulsar::Authentication | virtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual const std::string | getAuthMethodName () const =0 |
virtual Result | getAuthData (AuthenticationDataPtr &authDataContent) |
+Static Public Member Functions | |
static ParamMap | parseDefaultFormatAuthParams (const std::string &authParamsString) |
+Protected Attributes | |
+AuthenticationDataPtr | authData_ |
+Friends | |
+class | ClientConfiguration |
+
|
+ +inlinevirtual | +
Get AuthenticationData from the current instance
+[out] | authDataContent | the shared pointer of AuthenticationData. The content of AuthenticationData is changed to the internal data of the current instance. |
Reimplemented in pulsar::AuthAthenz, pulsar::AuthBasic, pulsar::AuthOauth2, pulsar::AuthTls, and pulsar::AuthToken.
+ +
+
|
+ +pure virtual | +
Implemented in pulsar::AuthAthenz, pulsar::AuthBasic, pulsar::AuthOauth2, pulsar::AuthTls, and pulsar::AuthToken.
+ +
+
|
+ +static | +
Parse the authentication parameter string to a map whose key and value are both strings
+The parameter string can have multiple lines. The format of each line is a comma-separated “key:value” string.
+For example, “k1:v1,k2:v2” is parsed to two key-value pairs (k1, v1)
and (k2, v2)
.
authParamsString | the authentication parameter string to be parsed |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::AuthenticationDataProvider, including all inherited members.
+AuthenticationDataProvider() (defined in pulsar::AuthenticationDataProvider) | pulsar::AuthenticationDataProvider | protected |
getCommandData() | pulsar::AuthenticationDataProvider | virtual |
getHttpAuthType() | pulsar::AuthenticationDataProvider | virtual |
getHttpHeaders() | pulsar::AuthenticationDataProvider | virtual |
getTlsCertificates() | pulsar::AuthenticationDataProvider | virtual |
getTlsPrivateKey() | pulsar::AuthenticationDataProvider | virtual |
hasDataForHttp() | pulsar::AuthenticationDataProvider | virtual |
hasDataForTls() | pulsar::AuthenticationDataProvider | virtual |
hasDataFromCommand() | pulsar::AuthenticationDataProvider | virtual |
~AuthenticationDataProvider() (defined in pulsar::AuthenticationDataProvider) | pulsar::AuthenticationDataProvider | virtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual bool | hasDataForTls () |
virtual std::string | getTlsCertificates () |
virtual std::string | getTlsPrivateKey () |
virtual bool | hasDataForHttp () |
virtual std::string | getHttpAuthType () |
virtual std::string | getHttpHeaders () |
virtual bool | hasDataFromCommand () |
virtual std::string | getCommandData () |
+
|
+ +virtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
+
|
+ +virtual | +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::BatchReceivePolicy, including all inherited members.
+BatchReceivePolicy() | pulsar::BatchReceivePolicy | |
BatchReceivePolicy(int maxNumMessage, long maxNumBytes, long timeoutMs) | pulsar::BatchReceivePolicy | |
getMaxNumBytes() const | pulsar::BatchReceivePolicy | |
getMaxNumMessages() const | pulsar::BatchReceivePolicy | |
getTimeoutMs() const | pulsar::BatchReceivePolicy |
+ pulsar-client-cpp
+
+ |
+
#include <BatchReceivePolicy.h>
+Public Member Functions | |
BatchReceivePolicy () | |
BatchReceivePolicy (int maxNumMessage, long maxNumBytes, long timeoutMs) | |
long | getTimeoutMs () const |
int | getMaxNumMessages () const |
long | getMaxNumBytes () const |
Configuration for message batch receive Consumer#batchReceive()
Consumer#batchReceiveAsync()
.
Batch receive policy can limit the number and bytes of messages in a single batch, and can specify a timeout for waiting for enough messages for this batch.
+A batch receive action is completed as long as any one of the conditions (the batch has enough number or size of messages, or the waiting timeout is passed) are met.
+Examples: 1.If set maxNumMessages = 10, maxSizeOfMessages = 1MB and without timeout, it means Consumer#batchReceive()
will always wait until there is enough messages. 2.If set maxNumberOfMessages = 0, maxNumBytes = 0 and timeout = 100ms, it means Consumer#batchReceive()
will wait for 100ms no matter whether there are enough messages.
Note: Must specify messages limitation(maxNumMessages, maxNumBytes) or wait timeout. Otherwise, Messages
ingest Message
will never end.
pulsar::BatchReceivePolicy::BatchReceivePolicy | +( | +) | ++ |
Default value: {maxNumMessage: -1, maxNumBytes: 10 * 1024 * 1024, timeoutMs: 100}
+ +pulsar::BatchReceivePolicy::BatchReceivePolicy | +( | +int | maxNumMessage, | +
+ | + | long | maxNumBytes, | +
+ | + | long | timeoutMs ) | +
maxNumMessage | Max num message, a non-positive value means no limit. |
maxNumBytes | Max num bytes, a non-positive value means no limit. |
timeoutMs | The receive timeout, a non-positive value means no limit. |
std::invalid_argument | if all arguments are non-positive |
long pulsar::BatchReceivePolicy::getMaxNumBytes | +( | +) | +const | +
Get max num bytes.
int pulsar::BatchReceivePolicy::getMaxNumMessages | +( | +) | +const | +
Get the maximum number of messages.
long pulsar::BatchReceivePolicy::getTimeoutMs | +( | +) | +const | +
Get max time out ms.
+
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::BrokerConsumerStats, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
+ | BrokerConsumerStats (std::shared_ptr< BrokerConsumerStatsImplBase > impl) |
virtual bool | isValid () const |
virtual double | getMsgRateOut () const |
virtual double | getMsgThroughputOut () const |
virtual double | getMsgRateRedeliver () const |
virtual const std::string | getConsumerName () const |
virtual uint64_t | getAvailablePermits () const |
virtual uint64_t | getUnackedMessages () const |
virtual bool | isBlockedConsumerOnUnackedMsgs () const |
virtual const std::string | getAddress () const |
virtual const std::string | getConnectedSince () const |
virtual const ConsumerType | getType () const |
virtual double | getMsgRateExpired () const |
virtual uint64_t | getMsgBacklog () const |
std::shared_ptr< BrokerConsumerStatsImplBase > | getImpl () const |
+Friends | |
+class | PulsarWrapper |
+PULSAR_PUBLIC std::ostream & | operator<< (std::ostream &os, const BrokerConsumerStats &obj) |
+
|
+ +virtual | +
Returns the Address of this consumer
+ +
+
|
+ +virtual | +
Returns the Number of available message permits for the consumer
+ +
+
|
+ +virtual | +
Returns the Timestamp of connection
+ +
+
|
+ +virtual | +
Returns the Name of the consumer
+ +std::shared_ptr< BrokerConsumerStatsImplBase > pulsar::BrokerConsumerStats::getImpl | +( | +) | +const | +
+
|
+ +virtual | +
Returns the Number of messages in the subscription backlog
+ +
+
|
+ +virtual | +
Returns the rate of messages expired on this subscription. msg/s
+ +
+
|
+ +virtual | +
Returns the rate of messages delivered to the consumer. msg/s
+ +
+
|
+ +virtual | +
Returns the rate of messages redelivered by this consumer. msg/s
+ +
+
|
+ +virtual | +
Returns the throughput delivered to the consumer. bytes/s
+ +
+
|
+ +virtual | +
Returns Whether this subscription is Exclusive or Shared or Failover
+ +
+
|
+ +virtual | +
Returns the Number of unacknowledged messages for the consumer
+ +
+
|
+ +virtual | +
Returns true if the consumer is blocked due to unacked messages.
+
+
|
+ +virtual | +
Returns true if the Stats are still valid
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::CachedToken, including all inherited members.
+CachedToken() (defined in pulsar::CachedToken) | pulsar::CachedToken | protected |
getAuthData()=0 | pulsar::CachedToken | pure virtual |
isExpired()=0 | pulsar::CachedToken | pure virtual |
~CachedToken() (defined in pulsar::CachedToken) | pulsar::CachedToken | virtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual bool | isExpired ()=0 |
virtual AuthenticationDataPtr | getAuthData ()=0 |
+
|
+ +pure virtual | +
Get AuthenticationData from the current instance
+
+
|
+ +pure virtual | +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Client, including all inherited members.
+Client(const std::string &serviceUrl) | pulsar::Client | |
Client(const std::string &serviceUrl, const ClientConfiguration &clientConfiguration) | pulsar::Client | |
close() | pulsar::Client | |
closeAsync(CloseCallback callback) | pulsar::Client | |
createProducer(const std::string &topic, Producer &producer) | pulsar::Client | |
createProducer(const std::string &topic, const ProducerConfiguration &conf, Producer &producer) | pulsar::Client | |
createProducerAsync(const std::string &topic, CreateProducerCallback callback) | pulsar::Client | |
createProducerAsync(const std::string &topic, ProducerConfiguration conf, CreateProducerCallback callback) | pulsar::Client | |
createReader(const std::string &topic, const MessageId &startMessageId, const ReaderConfiguration &conf, Reader &reader) | pulsar::Client | |
createReaderAsync(const std::string &topic, const MessageId &startMessageId, const ReaderConfiguration &conf, ReaderCallback callback) | pulsar::Client | |
createTableView(const std::string &topic, const TableViewConfiguration &conf, TableView &tableView) | pulsar::Client | |
createTableViewAsync(const std::string &topic, const TableViewConfiguration &conf, TableViewCallback callBack) | pulsar::Client | |
getNumberOfConsumers() | pulsar::Client | |
getNumberOfProducers() | pulsar::Client | |
getPartitionsForTopic(const std::string &topic, std::vector< std::string > &partitions) | pulsar::Client | |
getPartitionsForTopicAsync(const std::string &topic, GetPartitionsCallback callback) | pulsar::Client | |
getSchemaInfoAsync(const std::string &topic, int64_t version, std::function< void(Result, const SchemaInfo &)> callback) | pulsar::Client | |
PulsarFriend (defined in pulsar::Client) | pulsar::Client | friend |
PulsarWrapper (defined in pulsar::Client) | pulsar::Client | friend |
shutdown() | pulsar::Client | |
subscribe(const std::string &topic, const std::string &subscriptionName, Consumer &consumer) | pulsar::Client | |
subscribe(const std::string &topic, const std::string &subscriptionName, const ConsumerConfiguration &conf, Consumer &consumer) | pulsar::Client | |
subscribe(const std::vector< std::string > &topics, const std::string &subscriptionName, Consumer &consumer) | pulsar::Client | |
subscribe(const std::vector< std::string > &topics, const std::string &subscriptionName, const ConsumerConfiguration &conf, Consumer &consumer) | pulsar::Client | |
subscribeAsync(const std::string &topic, const std::string &subscriptionName, SubscribeCallback callback) | pulsar::Client | |
subscribeAsync(const std::string &topic, const std::string &subscriptionName, const ConsumerConfiguration &conf, SubscribeCallback callback) | pulsar::Client | |
subscribeAsync(const std::vector< std::string > &topics, const std::string &subscriptionName, SubscribeCallback callback) | pulsar::Client | |
subscribeAsync(const std::vector< std::string > &topics, const std::string &subscriptionName, const ConsumerConfiguration &conf, SubscribeCallback callback) | pulsar::Client | |
subscribeWithRegex(const std::string ®exPattern, const std::string &subscriptionName, Consumer &consumer) | pulsar::Client | |
subscribeWithRegex(const std::string ®exPattern, const std::string &subscriptionName, const ConsumerConfiguration &conf, Consumer &consumer) | pulsar::Client | |
subscribeWithRegexAsync(const std::string ®exPattern, const std::string &subscriptionName, SubscribeCallback callback) | pulsar::Client | |
subscribeWithRegexAsync(const std::string ®exPattern, const std::string &subscriptionName, const ConsumerConfiguration &conf, SubscribeCallback callback) | pulsar::Client |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
Client (const std::string &serviceUrl) | |
Client (const std::string &serviceUrl, const ClientConfiguration &clientConfiguration) | |
Result | createProducer (const std::string &topic, Producer &producer) |
Result | createProducer (const std::string &topic, const ProducerConfiguration &conf, Producer &producer) |
void | createProducerAsync (const std::string &topic, CreateProducerCallback callback) |
void | createProducerAsync (const std::string &topic, ProducerConfiguration conf, CreateProducerCallback callback) |
Result | subscribe (const std::string &topic, const std::string &subscriptionName, Consumer &consumer) |
Result | subscribe (const std::string &topic, const std::string &subscriptionName, const ConsumerConfiguration &conf, Consumer &consumer) |
void | subscribeAsync (const std::string &topic, const std::string &subscriptionName, SubscribeCallback callback) |
void | subscribeAsync (const std::string &topic, const std::string &subscriptionName, const ConsumerConfiguration &conf, SubscribeCallback callback) |
Result | subscribe (const std::vector< std::string > &topics, const std::string &subscriptionName, Consumer &consumer) |
Result | subscribe (const std::vector< std::string > &topics, const std::string &subscriptionName, const ConsumerConfiguration &conf, Consumer &consumer) |
void | subscribeAsync (const std::vector< std::string > &topics, const std::string &subscriptionName, SubscribeCallback callback) |
void | subscribeAsync (const std::vector< std::string > &topics, const std::string &subscriptionName, const ConsumerConfiguration &conf, SubscribeCallback callback) |
Result | subscribeWithRegex (const std::string ®exPattern, const std::string &subscriptionName, Consumer &consumer) |
Result | subscribeWithRegex (const std::string ®exPattern, const std::string &subscriptionName, const ConsumerConfiguration &conf, Consumer &consumer) |
void | subscribeWithRegexAsync (const std::string ®exPattern, const std::string &subscriptionName, SubscribeCallback callback) |
void | subscribeWithRegexAsync (const std::string ®exPattern, const std::string &subscriptionName, const ConsumerConfiguration &conf, SubscribeCallback callback) |
Result | createReader (const std::string &topic, const MessageId &startMessageId, const ReaderConfiguration &conf, Reader &reader) |
void | createReaderAsync (const std::string &topic, const MessageId &startMessageId, const ReaderConfiguration &conf, ReaderCallback callback) |
Result | createTableView (const std::string &topic, const TableViewConfiguration &conf, TableView &tableView) |
void | createTableViewAsync (const std::string &topic, const TableViewConfiguration &conf, TableViewCallback callBack) |
Result | getPartitionsForTopic (const std::string &topic, std::vector< std::string > &partitions) |
void | getPartitionsForTopicAsync (const std::string &topic, GetPartitionsCallback callback) |
Result | close () |
void | closeAsync (CloseCallback callback) |
void | shutdown () |
uint64_t | getNumberOfProducers () |
Get the number of alive producers on the current client. | |
uint64_t | getNumberOfConsumers () |
Get the number of alive consumers on the current client. | |
void | getSchemaInfoAsync (const std::string &topic, int64_t version, std::function< void(Result, const SchemaInfo &)> callback) |
+Friends | |
+class | PulsarFriend |
+class | PulsarWrapper |
pulsar::Client::Client | +( | +const std::string & | serviceUrl | ) | ++ |
Create a Pulsar client object connecting to the specified cluster address and using the default configuration.
+serviceUrl | the Pulsar endpoint to use (eg: pulsar://localhost:6650) |
std::invalid_argument | if serviceUrl is invalid |
pulsar::Client::Client | +( | +const std::string & | serviceUrl, | +
+ | + | const ClientConfiguration & | clientConfiguration ) | +
Create a Pulsar client object connecting to the specified cluster address and using the specified configuration.
+serviceUrl | the Pulsar endpoint to use (eg: http://brokerv2-pdev.messaging.corp.gq1.yahoo.com:4080 for Sandbox access) |
clientConfiguration | the client configuration to use |
std::invalid_argument | if serviceUrl is invalid |
Result pulsar::Client::close | +( | +) | ++ |
void pulsar::Client::closeAsync | +( | +CloseCallback | callback | ) | ++ |
Asynchronously close the Pulsar client and release all resources.
+All producers, consumers, and readers are orderly closed. The client waits until all pending write requests are persisted.
+callback | the callback that is triggered when the Pulsar client is asynchronously closed successfully or not |
Result pulsar::Client::createProducer | +( | +const std::string & | topic, | +
+ | + | const ProducerConfiguration & | conf, | +
+ | + | Producer & | producer ) | +
Create a producer with specified configuration
+ +topic | the topic where the new producer will publish |
conf | the producer config to use |
producer | a non-const reference where the new producer will be copied |
Result pulsar::Client::createProducer | +( | +const std::string & | topic, | +
+ | + | Producer & | producer ) | +
Create a producer with default configuration
+ +topic | the topic where the new producer will publish |
producer | a non-const reference where the new producer will be copied |
void pulsar::Client::createProducerAsync | +( | +const std::string & | topic, | +
+ | + | CreateProducerCallback | callback ) | +
Asynchronously create a producer with the default ProducerConfiguration for publishing on a specific topic
+topic | the name of the topic where to produce |
callback | the callback that is triggered when the producer is created successfully or not |
callback | Callback function that is invoked when the operation is completed |
void pulsar::Client::createProducerAsync | +( | +const std::string & | topic, | +
+ | + | ProducerConfiguration | conf, | +
+ | + | CreateProducerCallback | callback ) | +
Asynchronously create a producer with the customized ProducerConfiguration for publishing on a specific topic
+topic | the name of the topic where to produce |
conf | the customized ProducerConfiguration |
Result pulsar::Client::createReader | +( | +const std::string & | topic, | +
+ | + | const MessageId & | startMessageId, | +
+ | + | const ReaderConfiguration & | conf, | +
+ | + | Reader & | reader ) | +
Create a topic reader with given ReaderConfiguration
for reading messages from the specified topic.
The Reader provides a low-level abstraction that allows for manual positioning in the topic, without using a subscription. Reader can only work on non-partitioned topics.
+The initial reader positioning is done by specifying a message id. The options are:
MessageId.earliest
: Start reading from the earliest message available in the topic MessageId.latest
: Start reading from the end topic, only getting messages published after the reader was created MessageId
: When passing a particular message id, the reader will position itself on that specific position. The first message to be read will be the message next to the specified messageId. topic | The name of the topic where to read |
startMessageId | The message id where the reader will position itself. The first message returned will be the one after the specified startMessageId |
conf | The ReaderConfiguration object |
Reader
object void pulsar::Client::createReaderAsync | +( | +const std::string & | topic, | +
+ | + | const MessageId & | startMessageId, | +
+ | + | const ReaderConfiguration & | conf, | +
+ | + | ReaderCallback | callback ) | +
Asynchronously create a topic reader with the customized ReaderConfiguration for reading messages from the specified topic.
+The Reader provides a low-level abstraction that allows for manual positioning in the topic, without using a subscription. The reader can only work on non-partitioned topics.
+The initial reader positioning is done by specifying a message ID. The options are as below:
MessageId.earliest
: start reading from the earliest message available in the topic MessageId.latest
: start reading from the latest topic, only getting messages published after the reader was created MessageId
: when passing a particular message ID, the reader positions itself on that is the message next to the specified messageId. topic | the name of the topic where to read |
startMessageId | the message ID where the reader positions itself. The first message returned is the one after the specified startMessageId |
conf | the ReaderConfiguration object |
Result pulsar::Client::createTableView | +( | +const std::string & | topic, | +
+ | + | const TableViewConfiguration & | conf, | +
+ | + | TableView & | tableView ) | +
Create a table view with given TableViewConfiguration
for specified topic.
The TableView provides a key-value map view of a compacted topic. Messages without keys will be ignored.
+topic | The name of the topic. |
conf | The TableViewConfiguration object |
tableView | The TableView object |
void pulsar::Client::createTableViewAsync | +( | +const std::string & | topic, | +
+ | + | const TableViewConfiguration & | conf, | +
+ | + | TableViewCallback | callBack ) | +
Async create a table view with given TableViewConfiguration
for specified topic.
The TableView provides a key-value map view of a compacted topic. Messages without keys will be ignored.
+topic | The name of the topic. |
conf | The TableViewConfiguration object |
callBack | The callback that is triggered when the TableView is successfully linked to the topic and the map is built from a message that already exists |
uint64_t pulsar::Client::getNumberOfConsumers | +( | +) | ++ |
Get the number of alive consumers on the current client.
+uint64_t pulsar::Client::getNumberOfProducers | +( | +) | ++ |
Get the number of alive producers on the current client.
+Result pulsar::Client::getPartitionsForTopic | +( | +const std::string & | topic, | +
+ | + | std::vector< std::string > & | partitions ) | +
Get the list of partitions for a given topic.
+If the topic is partitioned, this will return a list of partition names. If the topic is not partitioned, the returned list will contain the topic name itself.
+This can be used to discover the partitions and create Reader, Consumer or Producer instances directly on a particular partition.
+topic | the topic name |
void pulsar::Client::getPartitionsForTopicAsync | +( | +const std::string & | topic, | +
+ | + | GetPartitionsCallback | callback ) | +
Get the list of partitions for a given topic in asynchronous mode.
+If the topic is partitioned, this will return a list of partition names. If the topic is not partitioned, the returned list will contain the topic name itself.
+This can be used to discover the partitions and create Reader, Consumer or Producer instances directly on a particular partition.
+topic | the topic name |
callback | the callback that will be invoked when the list of partitions is available |
void pulsar::Client::getSchemaInfoAsync | +( | +const std::string & | topic, | +
+ | + | int64_t | version, | +
+ | + | std::function< void(Result, const SchemaInfo &)> | callback ) | +
Asynchronously get the SchemaInfo of a topic and a specific version.
+@topic the topic name
void pulsar::Client::shutdown | +( | +) | ++ |
Perform immediate shutdown of Pulsar client.
+Release all resources and close all producer, consumer, and readers without waiting for ongoing operations to complete.
+ +Result pulsar::Client::subscribe | +( | +const std::string & | topic, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | const ConsumerConfiguration & | conf, | +
+ | + | Consumer & | consumer ) | +
Subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+topic | the topic name | |
subscriptionName | the subscription name | |
[out] | consumer | the consumer instance to be returned |
Result pulsar::Client::subscribe | +( | +const std::string & | topic, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | Consumer & | consumer ) | +
Subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+topic | the topic name | |
subscriptionName | the subscription name | |
[out] | consumer | the consumer instance to be returned |
Result pulsar::Client::subscribe | +( | +const std::vector< std::string > & | topics, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | const ConsumerConfiguration & | conf, | +
+ | + | Consumer & | consumer ) | +
Subscribe to multiple topics with the customized ConsumerConfiguration under the same namespace
+topics | a list of topic names to subscribe to | |
subscriptionName | the subscription name | |
conf | the customized ConsumerConfiguration | |
[out] | consumer | the consumer instance to be returned |
Result pulsar::Client::subscribe | +( | +const std::vector< std::string > & | topics, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | Consumer & | consumer ) | +
Subscribe to multiple topics under the same namespace.
+topics | a list of topic names to subscribe to | |
subscriptionName | the subscription name | |
[out] | consumer | the consumer instance to be returned |
void pulsar::Client::subscribeAsync | +( | +const std::string & | topic, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | const ConsumerConfiguration & | conf, | +
+ | + | SubscribeCallback | callback ) | +
Asynchronously subscribe to a given topic and subscription combination with the customized ConsumerConfiguration
+topic | the topic name |
subscriptionName | the subscription name |
conf | the customized ConsumerConfiguration |
callback | the callback that is triggered when a given topic and subscription combination with the customized ConsumerConfiguration are asynchronously subscribed successfully or not |
void pulsar::Client::subscribeAsync | +( | +const std::string & | topic, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | SubscribeCallback | callback ) | +
Asynchronously subscribe to a given topic and subscription combination with the default ConsumerConfiguration
+topic | the topic name |
subscriptionName | the subscription name |
callback | the callback that is triggered when a given topic and subscription combination with the default ConsumerConfiguration are asynchronously subscribed successfully or not |
void pulsar::Client::subscribeAsync | +( | +const std::vector< std::string > & | topics, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | const ConsumerConfiguration & | conf, | +
+ | + | SubscribeCallback | callback ) | +
Asynchronously subscribe to a list of topics and subscription combination using the customized ConsumerConfiguration
+topics | the topic list |
subscriptionName | the subscription name |
conf | the customized ConsumerConfiguration |
callback | the callback that is triggered when a list of topics and subscription combination using the customized ConsumerConfiguration are asynchronously subscribed successfully or not |
void pulsar::Client::subscribeAsync | +( | +const std::vector< std::string > & | topics, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | SubscribeCallback | callback ) | +
Asynchronously subscribe to a list of topics and subscription combination using the default ConsumerConfiguration
+topics | the topic list |
subscriptionName | the subscription name |
callback | the callback that is triggered when a list of topics and subscription combination using the default ConsumerConfiguration are asynchronously subscribed successfully or not |
Result pulsar::Client::subscribeWithRegex | +( | +const std::string & | regexPattern, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | const ConsumerConfiguration & | conf, | +
+ | + | Consumer & | consumer ) | +
Subscribe to multiple topics (which match given regexPatterns) with the customized ConsumerConfiguration under the same namespace
+ +Result pulsar::Client::subscribeWithRegex | +( | +const std::string & | regexPattern, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | Consumer & | consumer ) | +
Subscribe to multiple topics, which match given regexPattern, under the same namespace.
+ +void pulsar::Client::subscribeWithRegexAsync | +( | +const std::string & | regexPattern, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | const ConsumerConfiguration & | conf, | +
+ | + | SubscribeCallback | callback ) | +
Asynchronously subscribe to multiple topics (which match given regexPatterns) with the customized ConsumerConfiguration under the same namespace
+regexPattern | the regular expression for topics pattern |
subscriptionName | the subscription name |
conf | the ConsumerConfiguration |
callback | the callback that is triggered when multiple topics with the customized ConsumerConfiguration under the same namespace are asynchronously subscribed successfully or not |
void pulsar::Client::subscribeWithRegexAsync | +( | +const std::string & | regexPattern, | +
+ | + | const std::string & | subscriptionName, | +
+ | + | SubscribeCallback | callback ) | +
Asynchronously subscribe to multiple topics (which match given regexPatterns) with the default ConsumerConfiguration under the same namespace
+ + +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ClientConfiguration, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
enum | ProxyProtocol { 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 |
+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 | +
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::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 |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ConsoleLoggerFactory, including all inherited members.
+ConsoleLoggerFactory(Logger::Level level=Logger::LEVEL_INFO) (defined in pulsar::ConsoleLoggerFactory) | pulsar::ConsoleLoggerFactory | explicit |
getLogger(const std::string &fileName) override | pulsar::ConsoleLoggerFactory | virtual |
~ConsoleLoggerFactory() (defined in pulsar::ConsoleLoggerFactory) | pulsar::ConsoleLoggerFactory | |
~LoggerFactory() (defined in pulsar::LoggerFactory) | pulsar::LoggerFactory | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
#include <ConsoleLoggerFactory.h>
+Public Member Functions | |
+ | ConsoleLoggerFactory (Logger::Level level=Logger::LEVEL_INFO) |
Logger * | getLogger (const std::string &fileName) override |
Public Member Functions inherited from pulsar::LoggerFactory |
The default LoggerFactory of Client if USE_LOG4CXX
macro was not defined during compilation.
The log format is "yyyy-MM-dd HH:mm:ss,SSS Z <level> <thread-id> <file>:<line> | <msg>", like
+It uses std::cout
to prints logs to standard output. You can use this factory class to change your log level simply.
+
|
+ +overridevirtual | +
Create a Logger that is created from the filename
+fileName | the filename that is used to construct the Logger |
new
keyword in C++ Implements pulsar::LoggerFactory.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Consumer, including all inherited members.
+acknowledge(const Message &message) | pulsar::Consumer | |
acknowledge(const MessageId &messageId) | pulsar::Consumer | |
acknowledge(const MessageIdList &messageIdList) | pulsar::Consumer | |
acknowledgeAsync(const Message &message, ResultCallback callback) | pulsar::Consumer | |
acknowledgeAsync(const MessageId &messageId, ResultCallback callback) | pulsar::Consumer | |
acknowledgeAsync(const MessageIdList &messageIdList, ResultCallback callback) | pulsar::Consumer | |
acknowledgeCumulative(const Message &message) | pulsar::Consumer | |
acknowledgeCumulative(const MessageId &messageId) | pulsar::Consumer | |
acknowledgeCumulativeAsync(const Message &message, ResultCallback callback) | pulsar::Consumer | |
acknowledgeCumulativeAsync(const MessageId &messageId, ResultCallback callback) | pulsar::Consumer | |
batchReceive(Messages &msgs) | pulsar::Consumer | |
batchReceiveAsync(BatchReceiveCallback callback) | pulsar::Consumer | |
ClientImpl (defined in pulsar::Consumer) | pulsar::Consumer | friend |
close() | pulsar::Consumer | |
closeAsync(ResultCallback callback) | pulsar::Consumer | |
Consumer() | pulsar::Consumer | |
ConsumerImpl (defined in pulsar::Consumer) | pulsar::Consumer | friend |
ConsumerTest (defined in pulsar::Consumer) | pulsar::Consumer | friend |
getBrokerConsumerStats(BrokerConsumerStats &brokerConsumerStats) | pulsar::Consumer | |
getBrokerConsumerStatsAsync(BrokerConsumerStatsCallback callback) | pulsar::Consumer | |
getConsumerName() const | pulsar::Consumer | |
getLastMessageId(MessageId &messageId) | pulsar::Consumer | |
getLastMessageIdAsync(GetLastMessageIdCallback callback) | pulsar::Consumer | |
getSubscriptionName() const | pulsar::Consumer | |
getTopic() const | pulsar::Consumer | |
isConnected() const | pulsar::Consumer | |
MultiTopicsConsumerImpl (defined in pulsar::Consumer) | pulsar::Consumer | friend |
negativeAcknowledge(const Message &message) | pulsar::Consumer | |
negativeAcknowledge(const MessageId &messageId) | pulsar::Consumer | |
pauseMessageListener() | pulsar::Consumer | |
PulsarFriend (defined in pulsar::Consumer) | pulsar::Consumer | friend |
PulsarWrapper (defined in pulsar::Consumer) | pulsar::Consumer | friend |
receive(Message &msg) | pulsar::Consumer | |
receive(TypedMessage< T > &msg, typename TypedMessage< T >::Decoder decoder) (defined in pulsar::Consumer) | pulsar::Consumer | inline |
receive(Message &msg, int timeoutMs) | pulsar::Consumer | |
receive(TypedMessage< T > &msg, int timeoutMs, typename TypedMessage< T >::Decoder decoder) (defined in pulsar::Consumer) | pulsar::Consumer | inline |
receiveAsync(ReceiveCallback callback) | pulsar::Consumer | |
receiveAsync(std::function< void(Result result, const TypedMessage< T > &)> callback, typename TypedMessage< T >::Decoder decoder) (defined in pulsar::Consumer) | pulsar::Consumer | inline |
redeliverUnacknowledgedMessages() | pulsar::Consumer | |
resumeMessageListener() | pulsar::Consumer | |
seek(const MessageId &messageId) | pulsar::Consumer | |
seek(uint64_t timestamp) | pulsar::Consumer | |
seekAsync(const MessageId &messageId, ResultCallback callback) | pulsar::Consumer | virtual |
seekAsync(uint64_t timestamp, ResultCallback callback) | pulsar::Consumer | virtual |
unsubscribe() | pulsar::Consumer | |
unsubscribeAsync(ResultCallback callback) | pulsar::Consumer | |
~Consumer()=default (defined in pulsar::Consumer) | pulsar::Consumer | virtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
Consumer () | |
const std::string & | getTopic () const |
const std::string & | getSubscriptionName () const |
const std::string & | getConsumerName () const |
Result | unsubscribe () |
void | unsubscribeAsync (ResultCallback callback) |
Result | receive (Message &msg) |
+template<typename T > | |
Result | receive (TypedMessage< T > &msg, typename TypedMessage< T >::Decoder decoder) |
Result | receive (Message &msg, int timeoutMs) |
+template<typename T > | |
Result | receive (TypedMessage< T > &msg, int timeoutMs, typename TypedMessage< T >::Decoder decoder) |
void | receiveAsync (ReceiveCallback callback) |
+template<typename T > | |
void | receiveAsync (std::function< void(Result result, const TypedMessage< T > &)> callback, typename TypedMessage< T >::Decoder decoder) |
Result | batchReceive (Messages &msgs) |
void | batchReceiveAsync (BatchReceiveCallback callback) |
Result | acknowledge (const Message &message) |
Result | acknowledge (const MessageId &messageId) |
Result | acknowledge (const MessageIdList &messageIdList) |
void | acknowledgeAsync (const Message &message, ResultCallback callback) |
void | acknowledgeAsync (const MessageId &messageId, ResultCallback callback) |
void | acknowledgeAsync (const MessageIdList &messageIdList, ResultCallback callback) |
Result | acknowledgeCumulative (const Message &message) |
Result | acknowledgeCumulative (const MessageId &messageId) |
void | acknowledgeCumulativeAsync (const Message &message, ResultCallback callback) |
void | acknowledgeCumulativeAsync (const MessageId &messageId, ResultCallback callback) |
void | negativeAcknowledge (const Message &message) |
void | negativeAcknowledge (const MessageId &messageId) |
Result | close () |
void | closeAsync (ResultCallback callback) |
Result | pauseMessageListener () |
Result | resumeMessageListener () |
void | redeliverUnacknowledgedMessages () |
Result | getBrokerConsumerStats (BrokerConsumerStats &brokerConsumerStats) |
void | getBrokerConsumerStatsAsync (BrokerConsumerStatsCallback callback) |
Result | seek (const MessageId &messageId) |
Result | seek (uint64_t timestamp) |
virtual void | seekAsync (const MessageId &messageId, ResultCallback callback) |
virtual void | seekAsync (uint64_t timestamp, ResultCallback callback) |
bool | isConnected () const |
void | getLastMessageIdAsync (GetLastMessageIdCallback callback) |
Result | getLastMessageId (MessageId &messageId) |
+Friends | |
+class | PulsarFriend |
+class | PulsarWrapper |
+class | MultiTopicsConsumerImpl |
+class | ConsumerImpl |
+class | ClientImpl |
+class | ConsumerTest |
pulsar::Consumer::Consumer | +( | +) | ++ |
Construct an uninitialized consumer object
+ +Acknowledge the reception of a single message.
+This method will block until an acknowledgement is sent to the broker. After that, the message will not be re-delivered to this consumer.
+message | the message to acknowledge |
Acknowledge the reception of a single message.
+This method is blocked until an acknowledgement is sent to the broker. After that, the message is not re-delivered to the consumer.
+messageId | the MessageId to acknowledge |
Result pulsar::Consumer::acknowledge | +( | +const MessageIdList & | messageIdList | ) | ++ |
Acknowledge the consumption of a list of message.
messageIdList |
void pulsar::Consumer::acknowledgeAsync | +( | +const Message & | message, | +
+ | + | ResultCallback | callback ) | +
Asynchronously acknowledge the reception of a single message.
+This method will initiate the operation and return immediately. The provided callback will be triggered when the operation is complete.
+message | the message to acknowledge |
callback | callback that will be triggered when the message has been acknowledged |
void pulsar::Consumer::acknowledgeAsync | +( | +const MessageId & | messageId, | +
+ | + | ResultCallback | callback ) | +
Asynchronously acknowledge the reception of a single message.
+This method initiates the operation and returns the result immediately. The provided callback is triggered when the operation is completed.
+messageId | the messageId to acknowledge |
callback | the callback that is triggered when the message has been acknowledged or not |
void pulsar::Consumer::acknowledgeAsync | +( | +const MessageIdList & | messageIdList, | +
+ | + | ResultCallback | callback ) | +
Asynchronously acknowledge the consumption of a list of message.
messageIdList | |
callback | the callback that is triggered when the message has been acknowledged or not |
Acknowledge the reception of all the messages in the stream up to (and including) the provided message.
+This method will block until an acknowledgement is sent to the broker. After that, the messages will not be re-delivered to this consumer.
+Cumulative acknowledge cannot be used when the consumer type is set to ConsumerShared.
+It's equivalent to calling asyncAcknowledgeCumulative(const Message&, ResultCallback) and waiting for the callback to be triggered.
+message | the last message in the stream to acknowledge |
Acknowledge the reception of all the messages in the stream up to (and including) the provided message.
+This method is blocked until an acknowledgement is sent to the broker. After that, the message is not re-delivered to this consumer.
+Cumulative acknowledge cannot be used when the consumer type is set to ConsumerShared.
+It is equivalent to calling the asyncAcknowledgeCumulative(const Message&, ResultCallback) method and waiting for the callback to be triggered.
+messageId | the last messageId in the stream to acknowledge |
void pulsar::Consumer::acknowledgeCumulativeAsync | +( | +const Message & | message, | +
+ | + | ResultCallback | callback ) | +
Asynchronously acknowledge the reception of all the messages in the stream up to (and including) the provided message.
+This method will initiate the operation and return immediately. The provided callback will be triggered when the operation is complete.
+message | the message to acknowledge |
callback | callback that will be triggered when the message has been acknowledged |
void pulsar::Consumer::acknowledgeCumulativeAsync | +( | +const MessageId & | messageId, | +
+ | + | ResultCallback | callback ) | +
Asynchronously acknowledge the reception of all the messages in the stream up to (and including) the provided message.
+This method initiates the operation and returns the result immediately. The provided callback is triggered when the operation is completed.
+messageId | the messageId to acknowledge |
callback | the callback that is triggered when the message has been acknowledged or not |
Batch receiving messages.
+This calls blocks until has enough messages or wait timeout, more details to see BatchReceivePolicy
.
msgs | a non-const reference where the received messages will be copied |
void pulsar::Consumer::batchReceiveAsync | +( | +BatchReceiveCallback | callback | ) | ++ |
Async Batch receiving messages.
+Retrieves a message when it will be available and completes callback with received message.
+batchReceiveAsync() should be called subsequently once callback gets completed with received message. Else it creates backlog of receive requests in the application.
+BatchReceiveCallback | will be completed when messages are available. |
Result pulsar::Consumer::close | +( | +) | ++ |
Close the consumer and stop the broker to push more messages
+ +void pulsar::Consumer::closeAsync | +( | +ResultCallback | callback | ) | ++ |
Asynchronously close the consumer and stop the broker to push more messages
+ +Result pulsar::Consumer::getBrokerConsumerStats | +( | +BrokerConsumerStats & | brokerConsumerStats | ) | ++ |
Gets Consumer Stats from broker. The stats are cached for 30 seconds, if a call is made before the stats returned by the previous call expires then cached data will be returned. BrokerConsumerStats::isValid() function can be used to check if the stats are still valid.
+brokerConsumerStats | - if the function returns ResultOk, this object will contain consumer stats |
void pulsar::Consumer::getBrokerConsumerStatsAsync | +( | +BrokerConsumerStatsCallback | callback | ) | ++ |
Asynchronous call to gets Consumer Stats from broker. The stats are cached for 30 seconds, if a call is made before the stats returned by the previous call expires then cached data will be returned. BrokerConsumerStats::isValid() function can be used to check if the stats are still valid.
+callback | - callback function to get the brokerConsumerStats, if result is ResultOk then the brokerConsumerStats will be populated |
const std::string & pulsar::Consumer::getConsumerName | +( | +) | +const | +
Get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty.
+ +void pulsar::Consumer::getLastMessageIdAsync | +( | +GetLastMessageIdCallback | callback | ) | ++ |
Asynchronously get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty.
+ +const std::string & pulsar::Consumer::getSubscriptionName | +( | +) | +const | +
const std::string & pulsar::Consumer::getTopic | +( | +) | +const | +
bool pulsar::Consumer::isConnected | +( | +) | +const | +
void pulsar::Consumer::negativeAcknowledge | +( | +const Message & | message | ) | ++ |
Acknowledge the failure to process a single message.
+When a message is "negatively acked" it will be marked for redelivery after some fixed delay. The delay is configurable when constructing the consumer with ConsumerConfiguration#setNegativeAckRedeliveryDelayMs
.
This call is not blocking.
+Example of usage:
+while (true) {
+ Message msg;
+ consumer.receive(msg);
+
+ try {
+ // Process message...
+
+ consumer.acknowledge(msg);
+ } catch (Throwable t) {
+ log.warn("Failed to process message");
+ consumer.negativeAcknowledge(msg);
+ }
+}
+
message | The Message to be acknowledged |
void pulsar::Consumer::negativeAcknowledge | +( | +const MessageId & | messageId | ) | ++ |
Acknowledge the failure to process a single message.
+When a message is "negatively acked" it will be marked for redelivery after some fixed delay. The delay is configurable when constructing the consumer with ConsumerConfiguration#setNegativeAckRedeliveryDelayMs
.
This call is not blocking.
+Example of usage:
+while (true) {
+ Message msg;
+ consumer.receive(msg);
+
+ try {
+ // Process message...
+
+ consumer.acknowledge(msg);
+ } catch (Throwable t) {
+ log.warn("Failed to process message");
+ consumer.negativeAcknowledge(msg);
+ }
+}
+
messageId | The MessageId to be acknowledged |
Result pulsar::Consumer::pauseMessageListener | +( | +) | ++ |
Pause receiving messages via the messageListener, till resumeMessageListener() is called.
+ +Receive a single message.
+If a message is not immediately available, this method will block until a new message is available.
+msg | a non-const reference where the received message will be copied |
msg | a non-const reference where the received message will be copied |
timeoutMs | the receive timeout in milliseconds |
void pulsar::Consumer::receiveAsync | +( | +ReceiveCallback | callback | ) | ++ |
Receive a single message
+Retrieves a message when it will be available and completes callback with received message.
+receiveAsync() should be called subsequently once callback gets completed with received message. Else it creates backlog of receive requests in the application.
+ReceiveCallback | will be completed when message is available |
void pulsar::Consumer::redeliverUnacknowledgedMessages | +( | +) | ++ |
Redelivers all the unacknowledged messages. In Failover mode, the request is ignored if the consumer is not active for the given topic. In Shared mode, the consumers messages to be redelivered are distributed across all the connected consumers. This is a non blocking call and doesn't throw an exception. In case the connection breaks, the messages are redelivered after reconnect.
+ +Result pulsar::Consumer::resumeMessageListener | +( | +) | ++ |
Resume receiving the messages via the messageListener. Asynchronously receive all the messages enqueued from time pauseMessageListener() was called.
+ +Reset the subscription associated with this consumer to a specific message id. The message id can either be a specific message or represent the first or last messages in the topic.
+Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.
+messageId | the message id where to reposition the subscription |
Result pulsar::Consumer::seek | +( | +uint64_t | timestamp | ) | ++ |
Reset the subscription associated with this consumer to a specific message publish time.
+timestamp | the message publish time where to reposition the subscription |
+
|
+ +virtual | +
Asynchronously reset the subscription associated with this consumer to a specific message id. The message id can either be a specific message or represent the first or last messages in the topic.
+Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.
+messageId | the message id where to reposition the subscription |
+
|
+ +virtual | +
Asynchronously reset the subscription associated with this consumer to a specific message publish time.
+timestamp | the message publish time where to reposition the subscription |
Result pulsar::Consumer::unsubscribe | +( | +) | ++ |
Unsubscribe the current consumer from the topic.
+This method will block until the operation is completed. Once the consumer is unsubscribed, no more messages will be received and subsequent new messages will not be retained for this consumer.
+This consumer object cannot be reused.
+void pulsar::Consumer::unsubscribeAsync | +( | +ResultCallback | callback | ) | ++ |
Asynchronously unsubscribe the current consumer from the topic.
+This method will block until the operation is completed. Once the consumer is unsubscribed, no more messages will be received and subsequent new messages will not be retained for this consumer.
+This consumer object cannot be reused.
+callback | the callback to get notified when the operation is complete |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ConsumerConfiguration, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
#include <ConsumerConfiguration.h>
+Public Member Functions | |
+ | ConsumerConfiguration (const ConsumerConfiguration &) |
+ConsumerConfiguration & | operator= (const ConsumerConfiguration &) |
ConsumerConfiguration | clone () const |
ConsumerConfiguration & | setSchema (const SchemaInfo &schemaInfo) |
const SchemaInfo & | getSchema () const |
ConsumerConfiguration & | setConsumerType (ConsumerType consumerType) |
ConsumerType | getConsumerType () const |
ConsumerConfiguration & | setKeySharedPolicy (KeySharedPolicy keySharedPolicy) |
KeySharedPolicy | getKeySharedPolicy () const |
ConsumerConfiguration & | setMessageListener (MessageListener messageListener) |
+template<typename T > | |
ConsumerConfiguration & | setTypedMessageListener (std::function< void(Consumer &, const TypedMessage< T > &)> listener, typename TypedMessage< T >::Decoder decoder) |
MessageListener | getMessageListener () const |
bool | hasMessageListener () const |
ConsumerConfiguration & | setConsumerEventListener (ConsumerEventListenerPtr eventListener) |
ConsumerEventListenerPtr | getConsumerEventListener () const |
bool | hasConsumerEventListener () const |
void | setReceiverQueueSize (int size) |
int | getReceiverQueueSize () const |
void | setMaxTotalReceiverQueueSizeAcrossPartitions (int maxTotalReceiverQueueSizeAcrossPartitions) |
int | getMaxTotalReceiverQueueSizeAcrossPartitions () const |
void | setConsumerName (const std::string &consumerName) |
const std::string & | getConsumerName () const |
void | setUnAckedMessagesTimeoutMs (const uint64_t milliSeconds) |
long | getUnAckedMessagesTimeoutMs () const |
void | setTickDurationInMs (const uint64_t milliSeconds) |
long | getTickDurationInMs () const |
void | setNegativeAckRedeliveryDelayMs (long redeliveryDelayMillis) |
long | getNegativeAckRedeliveryDelayMs () const |
void | setAckGroupingTimeMs (long ackGroupingMillis) |
long | getAckGroupingTimeMs () const |
void | setAckGroupingMaxSize (long maxGroupingSize) |
long | getAckGroupingMaxSize () const |
void | setBrokerConsumerStatsCacheTimeInMs (const long cacheTimeInMs) |
long | getBrokerConsumerStatsCacheTimeInMs () const |
bool | isEncryptionEnabled () const |
const CryptoKeyReaderPtr | getCryptoKeyReader () const |
ConsumerConfiguration & | setCryptoKeyReader (CryptoKeyReaderPtr cryptoKeyReader) |
ConsumerCryptoFailureAction | getCryptoFailureAction () const |
ConsumerConfiguration & | setCryptoFailureAction (ConsumerCryptoFailureAction action) |
bool | isReadCompacted () const |
void | setReadCompacted (bool compacted) |
void | setPatternAutoDiscoveryPeriod (int periodInSeconds) |
int | getPatternAutoDiscoveryPeriod () const |
ConsumerConfiguration & | setRegexSubscriptionMode (RegexSubscriptionMode regexSubscriptionMode) |
RegexSubscriptionMode | getRegexSubscriptionMode () const |
void | setSubscriptionInitialPosition (InitialPosition subscriptionInitialPosition) |
InitialPosition | getSubscriptionInitialPosition () const |
void | setBatchReceivePolicy (const BatchReceivePolicy &batchReceivePolicy) |
const BatchReceivePolicy & | getBatchReceivePolicy () const |
void | setDeadLetterPolicy (const DeadLetterPolicy &deadLetterPolicy) |
const DeadLetterPolicy & | getDeadLetterPolicy () const |
void | setReplicateSubscriptionStateEnabled (bool enabled) |
bool | isReplicateSubscriptionStateEnabled () const |
bool | hasProperty (const std::string &name) const |
const std::string & | getProperty (const std::string &name) const |
std::map< std::string, std::string > & | getProperties () const |
ConsumerConfiguration & | setProperty (const std::string &name, const std::string &value) |
ConsumerConfiguration & | setProperties (const std::map< std::string, std::string > &properties) |
std::map< std::string, std::string > & | getSubscriptionProperties () const |
ConsumerConfiguration & | setSubscriptionProperties (const std::map< std::string, std::string > &subscriptionProperties) |
ConsumerConfiguration & | setPriorityLevel (int priorityLevel) |
int | getPriorityLevel () const |
ConsumerConfiguration & | setMaxPendingChunkedMessage (size_t maxPendingChunkedMessage) |
size_t | getMaxPendingChunkedMessage () const |
ConsumerConfiguration & | setAutoAckOldestChunkedMessageOnQueueFull (bool autoAckOldestChunkedMessageOnQueueFull) |
bool | isAutoAckOldestChunkedMessageOnQueueFull () const |
ConsumerConfiguration & | setExpireTimeOfIncompleteChunkedMessageMs (long expireTimeOfIncompleteChunkedMessageMs) |
long | getExpireTimeOfIncompleteChunkedMessageMs () const |
ConsumerConfiguration & | setStartMessageIdInclusive (bool startMessageIdInclusive) |
bool | isStartMessageIdInclusive () const |
ConsumerConfiguration & | setBatchIndexAckEnabled (bool enabled) |
bool | isBatchIndexAckEnabled () const |
ConsumerConfiguration & | intercept (const std::vector< ConsumerInterceptorPtr > &interceptors) |
+const std::vector< ConsumerInterceptorPtr > & | getInterceptors () const |
ConsumerConfiguration & | setAckReceiptEnabled (bool ackReceiptEnabled) |
bool | isAckReceiptEnabled () const |
ConsumerConfiguration & | setStartPaused (bool startPaused) |
bool | isStartPaused () const |
+Friends | |
+class | PulsarWrapper |
+class | PulsarFriend |
Class specifying the configuration of a consumer.
+ConsumerConfiguration pulsar::ConsumerConfiguration::clone | +( | +) | +const | +
Create a new instance of ConsumerConfiguration with the same initial settings as the current one.
+ +long pulsar::ConsumerConfiguration::getAckGroupingMaxSize | +( | +) | +const | +
Get max number of grouped messages within one grouping time window.
+long pulsar::ConsumerConfiguration::getAckGroupingTimeMs | +( | +) | +const | +
Get grouping time window in milliseconds.
+const BatchReceivePolicy & pulsar::ConsumerConfiguration::getBatchReceivePolicy | +( | +) | +const | +
Get batch receive policy.
+long pulsar::ConsumerConfiguration::getBrokerConsumerStatsCacheTimeInMs | +( | +) | +const | +
ConsumerEventListenerPtr pulsar::ConsumerConfiguration::getConsumerEventListener | +( | +) | +const | +
const std::string & pulsar::ConsumerConfiguration::getConsumerName | +( | +) | +const | +
ConsumerType pulsar::ConsumerConfiguration::getConsumerType | +( | +) | +const | +
ConsumerCryptoFailureAction pulsar::ConsumerConfiguration::getCryptoFailureAction | +( | +) | +const | +
const CryptoKeyReaderPtr pulsar::ConsumerConfiguration::getCryptoKeyReader | +( | +) | +const | +
const DeadLetterPolicy & pulsar::ConsumerConfiguration::getDeadLetterPolicy | +( | +) | +const | +
Get dead letter policy.
+long pulsar::ConsumerConfiguration::getExpireTimeOfIncompleteChunkedMessageMs | +( | +) | +const | +
Get the expire time of incomplete chunked message in milliseconds
+KeySharedPolicy pulsar::ConsumerConfiguration::getKeySharedPolicy | +( | +) | +const | +
size_t pulsar::ConsumerConfiguration::getMaxPendingChunkedMessage | +( | +) | +const | +
The associated getter of setMaxPendingChunkedMessage
+ +int pulsar::ConsumerConfiguration::getMaxTotalReceiverQueueSizeAcrossPartitions | +( | +) | +const | +
MessageListener pulsar::ConsumerConfiguration::getMessageListener | +( | +) | +const | +
long pulsar::ConsumerConfiguration::getNegativeAckRedeliveryDelayMs | +( | +) | +const | +
Get the configured delay to wait before re-delivering messages that have failed to be process.
+int pulsar::ConsumerConfiguration::getPatternAutoDiscoveryPeriod | +( | +) | +const | +
int pulsar::ConsumerConfiguration::getPriorityLevel | +( | +) | +const | +
std::map< std::string, std::string > & pulsar::ConsumerConfiguration::getProperties | +( | +) | +const | +
Get all the properties attached to this producer.
+ +const std::string & pulsar::ConsumerConfiguration::getProperty | +( | +const std::string & | name | ) | +const | +
Get the value of a specific property
+name | the name of the property |
int pulsar::ConsumerConfiguration::getReceiverQueueSize | +( | +) | +const | +
RegexSubscriptionMode pulsar::ConsumerConfiguration::getRegexSubscriptionMode | +( | +) | +const | +
const SchemaInfo & pulsar::ConsumerConfiguration::getSchema | +( | +) | +const | +
InitialPosition pulsar::ConsumerConfiguration::getSubscriptionInitialPosition | +( | +) | +const | +
InitialPosition
for the consumer std::map< std::string, std::string > & pulsar::ConsumerConfiguration::getSubscriptionProperties | +( | +) | +const | +
Get all the subscription properties attached to this subscription.
+ +long pulsar::ConsumerConfiguration::getTickDurationInMs | +( | +) | +const | +
long pulsar::ConsumerConfiguration::getUnAckedMessagesTimeoutMs | +( | +) | +const | +
bool pulsar::ConsumerConfiguration::hasConsumerEventListener | +( | +) | +const | +
bool pulsar::ConsumerConfiguration::hasMessageListener | +( | +) | +const | +
bool pulsar::ConsumerConfiguration::hasProperty | +( | +const std::string & | name | ) | +const | +
Check whether the message has a specific property attached.
+name | the name of the property to check |
ConsumerConfiguration & pulsar::ConsumerConfiguration::intercept | +( | +const std::vector< ConsumerInterceptorPtr > & | interceptors | ) | ++ |
Intercept the consumer
+interceptors | the list of interceptors to intercept the consumer |
bool pulsar::ConsumerConfiguration::isAckReceiptEnabled | +( | +) | +const | +
The associated getter of setAckReceiptEnabled.
+ +bool pulsar::ConsumerConfiguration::isAutoAckOldestChunkedMessageOnQueueFull | +( | +) | +const | +
The associated getter of setAutoAckOldestChunkedMessageOnQueueFull
+ +bool pulsar::ConsumerConfiguration::isBatchIndexAckEnabled | +( | +) | +const | +
The associated getter of setBatchingEnabled
+ +bool pulsar::ConsumerConfiguration::isEncryptionEnabled | +( | +) | +const | +
bool pulsar::ConsumerConfiguration::isReadCompacted | +( | +) | +const | +
bool pulsar::ConsumerConfiguration::isReplicateSubscriptionStateEnabled | +( | +) | +const | +
bool pulsar::ConsumerConfiguration::isStartMessageIdInclusive | +( | +) | +const | +
The associated getter of setStartMessageIdInclusive
+ +bool pulsar::ConsumerConfiguration::isStartPaused | +( | +) | +const | +
The associated getter of setStartPaused.
+ +void pulsar::ConsumerConfiguration::setAckGroupingMaxSize | +( | +long | maxGroupingSize | ) | ++ |
Set max number of grouped messages within one grouping time window. If it's set to a non-positive value, number of grouped messages is not limited. Default is 1000.
+maxGroupingSize | max number of grouped messages with in one grouping time window. |
void pulsar::ConsumerConfiguration::setAckGroupingTimeMs | +( | +long | ackGroupingMillis | ) | ++ |
Set time window in milliseconds for grouping message ACK requests. An ACK request is not sent to broker until the time window reaches its end, or the number of grouped messages reaches limit. Default is 100 milliseconds. If it's set to a non-positive value, ACK requests will be directly sent to broker without grouping.
+ackGroupMillis | time of ACK grouping window in milliseconds. |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setAckReceiptEnabled | +( | +bool | ackReceiptEnabled | ) | ++ |
Whether to receive the ACK receipt from broker.
+By default, when Consumer::acknowledge is called, it won't wait until the corresponding response from broker. After it's enabled, the acknowledge
method will return a Result that indicates if the acknowledgment succeeded.
Default: false
+ +ConsumerConfiguration & pulsar::ConsumerConfiguration::setAutoAckOldestChunkedMessageOnQueueFull | +( | +bool | autoAckOldestChunkedMessageOnQueueFull | ) | ++ |
Buffering large number of outstanding uncompleted chunked messages can create memory pressure and it can be guarded by providing the maxPendingChunkedMessage threshold. See setMaxPendingChunkedMessage. Once, consumer reaches this threshold, it drops the outstanding unchunked-messages by silently acking if autoAckOldestChunkedMessageOnQueueFull is true else it marks them for redelivery.
+Default: false
+autoAckOldestChunkedMessageOnQueueFull | whether to ack the discarded chunked message |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setBatchIndexAckEnabled | +( | +bool | enabled | ) | ++ |
Enable the batch index acknowledgment.
+It should be noted that this option can only work when the broker side also enables the batch index acknowledgment. See the acknowledgmentAtBatchIndexLevelEnabled
config in broker.conf
.
Default: false
+enabled | whether to enable the batch index acknowledgment |
void pulsar::ConsumerConfiguration::setBatchReceivePolicy | +( | +const BatchReceivePolicy & | batchReceivePolicy | ) | ++ |
Set batch receive policy.
+batchReceivePolicy | the default is {maxNumMessage: -1, maxNumBytes: 10 * 1024 * 1024, timeoutMs: 100} |
void pulsar::ConsumerConfiguration::setBrokerConsumerStatsCacheTimeInMs | +( | +const long | cacheTimeInMs | ) | ++ |
Set the time duration for which the broker side consumer stats will be cached in the client.
+Default: 30000, which means 30 seconds.
+cacheTimeInMs | in milliseconds |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setConsumerEventListener | +( | +ConsumerEventListenerPtr | eventListener | ) | ++ |
A event listener enables your application to react the consumer state change event (active or inactive).
+ +void pulsar::ConsumerConfiguration::setConsumerName | +( | +const std::string & | consumerName | ) | ++ |
Set the consumer name.
+consumerName |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setConsumerType | +( | +ConsumerType | consumerType | ) | ++ |
Specify the consumer type. The consumer type enables specifying the type of subscription. In Exclusive subscription, only a single consumer is allowed to attach to the subscription. Other consumers will get an error message. In Shared subscription, multiple consumers will be able to use the same subscription name and the messages will be dispatched in a round robin fashion. In Failover subscription, a primary-failover subscription model allows for multiple consumers to attach to a single subscription, though only one of them will be “master” at a given time. Only the primary consumer will receive messages. When the primary consumer gets disconnected, one among the failover consumers will be promoted to primary and will start getting messages.
+ +ConsumerConfiguration & pulsar::ConsumerConfiguration::setCryptoFailureAction | +( | +ConsumerCryptoFailureAction | action | ) | ++ |
Set the ConsumerCryptoFailureAction.
+ +ConsumerConfiguration & pulsar::ConsumerConfiguration::setCryptoKeyReader | +( | +CryptoKeyReaderPtr | cryptoKeyReader | ) | ++ |
Set the shared pointer to CryptoKeyReader.
+the | shared pointer to CryptoKeyReader |
void pulsar::ConsumerConfiguration::setDeadLetterPolicy | +( | +const DeadLetterPolicy & | deadLetterPolicy | ) | ++ |
Set dead letter policy for consumer
+By default, some messages are redelivered many times, even to the extent that they can never be stopped. By using the dead letter mechanism, messages have the max redelivery count, when they exceeding the maximum number of redeliveries. Messages are sent to dead letter topics and acknowledged automatically.
+You can enable the dead letter mechanism by setting the dead letter policy. Example:
++* DeadLetterPolicy dlqPolicy = DeadLetterPolicyBuilder() + .maxRedeliverCount(10) + .build(); +
Default dead letter topic name is {TopicName}-{Subscription}-DLQ. To set a custom dead letter topic name
+DeadLetterPolicy dlqPolicy = DeadLetterPolicyBuilder() + .deadLetterTopic("dlq-topic") + .maxRedeliverCount(10) + .initialSubscriptionName("init-sub-name") + .build(); +
deadLetterPolicy | Default value is empty |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setExpireTimeOfIncompleteChunkedMessageMs | +( | +long | expireTimeOfIncompleteChunkedMessageMs | ) | ++ |
If producer fails to publish all the chunks of a message then consumer can expire incomplete chunks if consumer won't be able to receive all chunks in expire times. Use value 0 to disable this feature.
+Default: 60000, which means 1 minutes
+expireTimeOfIncompleteChunkedMessageMs | expire time in milliseconds |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setKeySharedPolicy | +( | +KeySharedPolicy | keySharedPolicy | ) | ++ |
Set KeyShared subscription policy for consumer.
+By default, KeyShared subscription use auto split hash range to maintain consumers. If you want to set a different KeyShared policy, you can set by following example:
+keySharedPolicy | The KeySharedPolicy want to specify |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setMaxPendingChunkedMessage | +( | +size_t | maxPendingChunkedMessage | ) | ++ |
Consumer buffers chunk messages into memory until it receives all the chunks of the original message. While consuming chunk-messages, chunks from same message might not be contiguous in the stream and they might be mixed with other messages' chunks. so, consumer has to maintain multiple buffers to manage chunks coming from different messages. This mainly happens when multiple publishers are publishing messages on the topic concurrently or publisher failed to publish all chunks of the messages.
+eg: M1-C1, M2-C1, M1-C2, M2-C2 Here, Messages M1-C1 and M1-C2 belong to original message M1, M2-C1 and M2-C2 belong to M2 message.
+Buffering large number of outstanding uncompleted chunked messages can create memory pressure and it can be guarded by providing this maxPendingChunkedMessage threshold. Once, consumer reaches this threshold, it drops the outstanding unchunked-messages by silently acking or asking broker to redeliver later by marking it unacked. See setAutoAckOldestChunkedMessageOnQueueFull.
+If it's zero, the pending chunked messages will not be limited.
+Default: 10
+maxPendingChunkedMessage | the number of max pending chunked messages |
void pulsar::ConsumerConfiguration::setMaxTotalReceiverQueueSizeAcrossPartitions | +( | +int | maxTotalReceiverQueueSizeAcrossPartitions | ) | ++ |
Set the max total receiver queue size across partitons.
+This setting is used to reduce the receiver queue size for individual partitions setReceiverQueueSize(int)
if the total exceeds this value (default: 50000).
maxTotalReceiverQueueSizeAcrossPartitions |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setMessageListener | +( | +MessageListener | messageListener | ) | ++ |
A message listener enables your application to configure how to process and acknowledge messages delivered. A listener will be called in order for every message received.
+ +void pulsar::ConsumerConfiguration::setNegativeAckRedeliveryDelayMs | +( | +long | redeliveryDelayMillis | ) | ++ |
Set the delay to wait before re-delivering messages that have failed to be process.
+When application uses Consumer#negativeAcknowledge(Message)
, the failed message will be redelivered after a fixed timeout. The default is 1 min.
redeliveryDelay | redelivery delay for failed messages |
timeUnit | unit in which the timeout is provided. |
void pulsar::ConsumerConfiguration::setPatternAutoDiscoveryPeriod | +( | +int | periodInSeconds | ) | ++ |
Set the time duration in minutes, for which the PatternMultiTopicsConsumer will do a pattern auto discovery. The default value is 60 seconds. less than 0 will disable auto discovery.
+periodInSeconds | period in seconds to do an auto discovery |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setPriorityLevel | +( | +int | priorityLevel | ) | ++ |
Set the Priority Level for consumer (0 is the default value and means the highest priority).
+priorityLevel | the priority of this consumer |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setProperties | +( | +const std::map< std::string, std::string > & | properties | ) | ++ |
Add all the properties in the provided map
+ +ConsumerConfiguration & pulsar::ConsumerConfiguration::setProperty | +( | +const std::string & | name, | +
+ | + | const std::string & | value ) | +
Sets a new property on a message.
name | the name of the property |
value | the associated value |
void pulsar::ConsumerConfiguration::setReadCompacted | +( | +bool | compacted | ) | ++ |
If enabled, the consumer reads messages from the compacted topics rather than reading the full message backlog of the topic. This means that if the topic has been compacted, the consumer only sees the latest value for each key in the topic, up until the point in the topic message backlog that has been compacted. Beyond that point, message is sent as normal.
+readCompacted
can only be enabled subscriptions to persistent topics, which have a single active consumer (for example, failure or exclusive subscriptions). Attempting to enable it on subscriptions to a non-persistent topics or on a shared subscription leads to the subscription call failure.
readCompacted | whether to read from the compacted topic |
void pulsar::ConsumerConfiguration::setReceiverQueueSize | +( | +int | size | ) | ++ |
Sets the size of the consumer receive queue.
+The consumer receive queue controls how many messages can be accumulated by the consumer before the application calls receive(). Using a higher value may potentially increase the consumer throughput at the expense of bigger memory utilization.
+Setting the consumer queue size to 0 decreases the throughput of the consumer by disabling pre-fetching of messages. This approach improves the message distribution on shared subscription by pushing messages only to the consumers that are ready to process them. Neither receive with timeout nor partitioned topics can be used if the consumer queue size is 0. The receive() function call should not be interrupted when the consumer queue size is 0.
+The default value is 1000 messages and it is appropriate for the most use cases.
+size | the new receiver queue size value |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setRegexSubscriptionMode | +( | +RegexSubscriptionMode | regexSubscriptionMode | ) | ++ |
Determines which topics this consumer should be subscribed to - Persistent, Non-Persistent, or AllTopics. Only used with pattern subscriptions.
+regexSubscriptionMode | The default value is PersistentOnly . |
void pulsar::ConsumerConfiguration::setReplicateSubscriptionStateEnabled | +( | +bool | enabled | ) | ++ |
Set whether the subscription status should be replicated. The default value is false
.
replicateSubscriptionState | whether the subscription status should be replicated |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setSchema | +( | +const SchemaInfo & | schemaInfo | ) | ++ |
Declare the schema of the data that this consumer will be accepting.
+The schema will be checked against the schema of the topic, and the consumer creation will fail if it's not compatible.
+schemaInfo | the schema definition object |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setStartMessageIdInclusive | +( | +bool | startMessageIdInclusive | ) | ++ |
Set the consumer to include the given position of any reset operation like Consumer::seek.
+Default: false
+startMessageIdInclusive | whether to include the reset position |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setStartPaused | +( | +bool | startPaused | ) | ++ |
Starts the consumer in a paused state.
+When enabled, the consumer does not immediately fetch messages when the consumer is created. Instead, the consumer waits to fetch messages until Consumer::resumeMessageListener is called.
+Default: false
+ +void pulsar::ConsumerConfiguration::setSubscriptionInitialPosition | +( | +InitialPosition | subscriptionInitialPosition | ) | ++ |
The default value is InitialPositionLatest
.
subscriptionInitialPosition | the initial position at which to set the cursor when subscribing to the topic for the first time |
ConsumerConfiguration & pulsar::ConsumerConfiguration::setSubscriptionProperties | +( | +const std::map< std::string, std::string > & | subscriptionProperties | ) | ++ |
Sets a new subscription properties for this subscription. Notice: SubscriptionProperties are immutable, and consumers under the same subscription will fail to create a subscription if they use different properties.
+subscriptionProperties | all the subscription properties in the provided map |
void pulsar::ConsumerConfiguration::setTickDurationInMs | +( | +const uint64_t | milliSeconds | ) | ++ |
Set the tick duration time that defines the granularity of the ack-timeout redelivery (in milliseconds).
+The default value is 1000, which means 1 second.
+Using a higher tick time reduces the memory overhead to track messages when the ack-timeout is set to a bigger value.
+milliSeconds | the tick duration time (in milliseconds) |
void pulsar::ConsumerConfiguration::setUnAckedMessagesTimeoutMs | +( | +const uint64_t | milliSeconds | ) | ++ |
Set the timeout in milliseconds for unacknowledged messages, the timeout needs to be greater than 10 seconds. An Exception is thrown if the given value is less than 10000 (10 seconds). If a successful acknowledgement is not sent within the timeout all the unacknowledged messages are redelivered.
+Default: 0, which means the the tracker for unacknowledged messages is disabled.
+timeout | in milliseconds |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ConsumerEventListener, including all inherited members.
+becameActive(Consumer consumer, int partitionId)=0 | pulsar::ConsumerEventListener | pure virtual |
becameInactive(Consumer consumer, int partitionId)=0 | pulsar::ConsumerEventListener | pure virtual |
~ConsumerEventListener() (defined in pulsar::ConsumerEventListener) | pulsar::ConsumerEventListener | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual void | becameActive (Consumer consumer, int partitionId)=0 |
Notified when the consumer group is changed, and the consumer becomes active. | |
virtual void | becameInactive (Consumer consumer, int partitionId)=0 |
Notified when the consumer group is changed, and the consumer is still inactive or becomes inactive. | |
+
|
+ +pure virtual | +
Notified when the consumer group is changed, and the consumer becomes active.
+consumer | the consumer that originated the event |
partitionId | the id of the partition that beconmes active. |
+
|
+ +pure virtual | +
Notified when the consumer group is changed, and the consumer is still inactive or becomes inactive.
+consumer | the consumer that originated the event |
partitionId | the id of the partition that is still inactive or becomes inactive. |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ConsumerInterceptor, including all inherited members.
+beforeConsume(const Consumer &consumer, const Message &message)=0 | pulsar::ConsumerInterceptor | pure virtual |
close() | pulsar::ConsumerInterceptor | inlinevirtual |
onAcknowledge(const Consumer &consumer, Result result, const MessageId &messageID)=0 | pulsar::ConsumerInterceptor | pure virtual |
onAcknowledgeCumulative(const Consumer &consumer, Result result, const MessageId &messageID)=0 | pulsar::ConsumerInterceptor | pure virtual |
onNegativeAcksSend(const Consumer &consumer, const std::set< MessageId > &messageIds)=0 | pulsar::ConsumerInterceptor | pure virtual |
~ConsumerInterceptor() (defined in pulsar::ConsumerInterceptor) | pulsar::ConsumerInterceptor | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
#include <ConsumerInterceptor.h>
+Public Member Functions | |
virtual void | close () |
virtual Message | beforeConsume (const Consumer &consumer, const Message &message)=0 |
virtual void | onAcknowledge (const Consumer &consumer, Result result, const MessageId &messageID)=0 |
virtual void | onAcknowledgeCumulative (const Consumer &consumer, Result result, const MessageId &messageID)=0 |
virtual void | onNegativeAcksSend (const Consumer &consumer, const std::set< MessageId > &messageIds)=0 |
A plugin interface that allows you to intercept (and possibly mutate) messages received by the consumer.
+A primary use case is to hook into consumer applications for custom monitoring, logging, etc.
+Exceptions thrown by interceptor methods will be caught, logged, but not propagated further.
+
+
|
+ +pure virtual | +
This is called just before the message is consumed.
+This method is allowed to modify message, in which case the new message will be returned.
+Any exception thrown by this method will be caught by the caller, logged, but not propagated to client.
+Since the consumer may run multiple interceptors, a particular interceptor's beforeConsume
callback will be called in the order. The first interceptor in the list gets the consumed message, the following interceptor will be passed the message returned by the previous interceptor, and so on. Since interceptors are allowed to modify message, interceptors may potentially get the messages already modified by other interceptors. However building a pipeline of mutable interceptors that depend on the output of the previous interceptor is discouraged, because of potential side-effects caused by interceptors potentially failing to modify the message and throwing an exception. if one of interceptors in the list throws an exception from beforeConsume
, the exception is caught, logged, and the next interceptor is called with the message returned by the last successful interceptor in the list, or otherwise the original consumed message.
consumer | the consumer which contains the interceptor |
message | the message to be consumed by the client |
+
|
+ +inlinevirtual | +
Close the interceptor
+ +
+
|
+ +pure virtual | +
This is called before consumer sends the acknowledgment to the broker.
+Any exception thrown by this method will be ignored by the caller.
+consumer | the consumer which contains the interceptor |
result | the result of the acknowledgement |
messageID | the message id to be acknowledged |
+
|
+ +pure virtual | +
This is called before consumer sends the cumulative acknowledgment to the broker.
+Any exception thrown by this method will be ignored by the caller.
+consumer | the consumer which contains the interceptor |
result | the result of the cumulative acknowledgement |
messageID | the message id to be acknowledged cumulatively |
+
|
+ +pure virtual | +
This method will be called when a redelivery from a negative acknowledge occurs.
+Any exception thrown by this method will be ignored by the caller.
+consumer | the consumer which contains the interceptor |
messageIds | the set of message ids to negative ack |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::CryptoKeyReader, including all inherited members.
+CryptoKeyReader() (defined in pulsar::CryptoKeyReader) | pulsar::CryptoKeyReader | |
getPrivateKey(const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const =0 | pulsar::CryptoKeyReader | pure virtual |
getPublicKey(const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const =0 | pulsar::CryptoKeyReader | pure virtual |
~CryptoKeyReader() (defined in pulsar::CryptoKeyReader) | pulsar::CryptoKeyReader | virtual |
+ pulsar-client-cpp
+
+ |
+
#include <CryptoKeyReader.h>
+Public Member Functions | |
virtual Result | getPublicKey (const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const =0 |
virtual Result | getPrivateKey (const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const =0 |
The abstract class that abstracts the access to a key store
+
+
|
+ +pure virtual | +
keyName | Unique name to identify the key |
metadata | Additional information needed to identify the key |
encKeyInfo | updated with details about the private key |
Implemented in pulsar::DefaultCryptoKeyReader.
+ +
+
|
+ +pure virtual | +
Return the encryption key corresponding to the key name in the argument
+This method should be implemented to return the EncryptionKeyInfo. This method will be called at the time of producer creation as well as consumer receiving messages. Hence, application should not make any blocking calls within the implementation.
+keyName | Unique name to identify the key |
metadata | Additional information needed to identify the key |
encKeyInfo | updated with details about the public key |
Implemented in pulsar::DefaultCryptoKeyReader.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::DeadLetterPolicy, including all inherited members.
+DeadLetterPolicy() (defined in pulsar::DeadLetterPolicy) | pulsar::DeadLetterPolicy | |
DeadLetterPolicyBuilder (defined in pulsar::DeadLetterPolicy) | pulsar::DeadLetterPolicy | friend |
getDeadLetterTopic() const | pulsar::DeadLetterPolicy | |
getInitialSubscriptionName() const | pulsar::DeadLetterPolicy | |
getMaxRedeliverCount() const | pulsar::DeadLetterPolicy |
+ pulsar-client-cpp
+
+ |
+
#include <DeadLetterPolicy.h>
+Public Member Functions | |
const std::string & | getDeadLetterTopic () const |
int | getMaxRedeliverCount () const |
const std::string & | getInitialSubscriptionName () const |
+Friends | |
+class | DeadLetterPolicyBuilder |
Configuration for the "dead letter queue" feature in consumer.
+see @DeadLetterPolicyBuilder
+const std::string & pulsar::DeadLetterPolicy::getDeadLetterTopic | +( | +) | +const | +
Get dead letter topic
+const std::string & pulsar::DeadLetterPolicy::getInitialSubscriptionName | +( | +) | +const | +
Get initial subscription name
+int pulsar::DeadLetterPolicy::getMaxRedeliverCount | +( | +) | +const | +
Get max redeliver count
+
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::DeadLetterPolicyBuilder, including all inherited members.
+build() | pulsar::DeadLetterPolicyBuilder | |
DeadLetterPolicyBuilder() (defined in pulsar::DeadLetterPolicyBuilder) | pulsar::DeadLetterPolicyBuilder | |
deadLetterTopic(const std::string &deadLetterTopic) | pulsar::DeadLetterPolicyBuilder | |
initialSubscriptionName(const std::string &initialSubscriptionName) | pulsar::DeadLetterPolicyBuilder | |
maxRedeliverCount(int maxRedeliverCount) | pulsar::DeadLetterPolicyBuilder |
+ pulsar-client-cpp
+
+ |
+
#include <DeadLetterPolicyBuilder.h>
+Public Member Functions | |
DeadLetterPolicyBuilder & | deadLetterTopic (const std::string &deadLetterTopic) |
DeadLetterPolicyBuilder & | maxRedeliverCount (int maxRedeliverCount) |
DeadLetterPolicyBuilder & | initialSubscriptionName (const std::string &initialSubscriptionName) |
DeadLetterPolicy | build () |
The builder to build a DeadLetterPolicyBuilder
+Example of building DeadLetterPolicy:
+DeadLetterPolicy pulsar::DeadLetterPolicyBuilder::build | +( | +) | ++ |
Build DeadLetterPolicy.
+DeadLetterPolicyBuilder & pulsar::DeadLetterPolicyBuilder::deadLetterTopic | +( | +const std::string & | deadLetterTopic | ) | ++ |
Set dead letter topic.
+deadLetterTopic | Name of the dead topic where the failing messages are sent. The default value is: sourceTopicName + "-" + subscriptionName + "-DLQ" |
DeadLetterPolicyBuilder & pulsar::DeadLetterPolicyBuilder::initialSubscriptionName | +( | +const std::string & | initialSubscriptionName | ) | ++ |
Set initial subscription name
+initialSubscriptionName | Name of the initial subscription name of the dead letter topic. If this field is not set, the initial subscription for the dead letter topic is not created. If this field is set but the broker's allowAutoSubscriptionCreation is disabled, the DLQ producer fails to be created. |
DeadLetterPolicyBuilder & pulsar::DeadLetterPolicyBuilder::maxRedeliverCount | +( | +int | maxRedeliverCount | ) | ++ |
Set max redeliver count
+maxRedeliverCount | Maximum number of times that a message is redelivered before being sent to the dead letter queue.
|
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::DefaultCryptoKeyReader, including all inherited members.
+create(const std::string &publicKeyPath, const std::string &privateKeyPath) (defined in pulsar::DefaultCryptoKeyReader) | pulsar::DefaultCryptoKeyReader | static |
CryptoKeyReader() (defined in pulsar::CryptoKeyReader) | pulsar::CryptoKeyReader | |
DefaultCryptoKeyReader(const std::string &publicKeyPath, const std::string &privateKeyPath) | pulsar::DefaultCryptoKeyReader | |
getPrivateKey(const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const | pulsar::DefaultCryptoKeyReader | virtual |
getPublicKey(const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const | pulsar::DefaultCryptoKeyReader | virtual |
~CryptoKeyReader() (defined in pulsar::CryptoKeyReader) | pulsar::CryptoKeyReader | virtual |
~DefaultCryptoKeyReader() (defined in pulsar::DefaultCryptoKeyReader) | pulsar::DefaultCryptoKeyReader |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
DefaultCryptoKeyReader (const std::string &publicKeyPath, const std::string &privateKeyPath) | |
Result | getPublicKey (const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const |
Result | getPrivateKey (const std::string &keyName, std::map< std::string, std::string > &metadata, EncryptionKeyInfo &encKeyInfo) const |
Public Member Functions inherited from pulsar::CryptoKeyReader |
+Static Public Member Functions | |
+static CryptoKeyReaderPtr | create (const std::string &publicKeyPath, const std::string &privateKeyPath) |
pulsar::DefaultCryptoKeyReader::DefaultCryptoKeyReader | +( | +const std::string & | publicKeyPath, | +
+ | + | const std::string & | privateKeyPath ) | +
The constructor of CryptoKeyReader
Configure the key reader to be used to decrypt the message payloads
+publicKeyPath | the path to the public key |
privateKeyPath | the path to the private key |
+
|
+ +virtual | +
Return the encryption key corresponding to the key name in the argument.
+[in] | keyName | the unique name to identify the key |
[in] | metadata | the additional information needed to identify the key |
[out] | encKeyInfo | the EncryptionKeyInfo with details about the private key |
Implements pulsar::CryptoKeyReader.
+ +
+
|
+ +virtual | +
Return the encryption key corresponding to the key name in the argument.
+This method should be implemented to return the EncryptionKeyInfo. This method is called when creating producers as well as allowing consumers to receive messages. Consequently, the application should not make any blocking calls within the implementation.
+[in] | keyName | the unique name to identify the key |
[in] | metadata | the additional information needed to identify the key |
[out] | encKeyInfo | the EncryptionKeyInfo with details about the public key |
Implements pulsar::CryptoKeyReader.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::DeprecatedException, including all inherited members.
+DeprecatedException(const std::string &__arg) (defined in pulsar::DeprecatedException) | pulsar::DeprecatedException | explicit |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
+ | DeprecatedException (const std::string &__arg) |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::EncryptionKeyInfo, including all inherited members.
+EncryptionKeyInfo() (defined in pulsar::EncryptionKeyInfo) | pulsar::EncryptionKeyInfo | |
EncryptionKeyInfo(std::string key, StringMap &metadata) | pulsar::EncryptionKeyInfo | |
getKey() | pulsar::EncryptionKeyInfo | |
getMetadata(void) | pulsar::EncryptionKeyInfo | |
PulsarWrapper (defined in pulsar::EncryptionKeyInfo) | pulsar::EncryptionKeyInfo | friend |
setKey(std::string key) | pulsar::EncryptionKeyInfo | |
setMetadata(StringMap &metadata) | pulsar::EncryptionKeyInfo | |
StringMap typedef (defined in pulsar::EncryptionKeyInfo) | pulsar::EncryptionKeyInfo |
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
+typedef std::map< std::string, std::string > | StringMap |
+Public Member Functions | |
EncryptionKeyInfo (std::string key, StringMap &metadata) | |
std::string & | getKey () |
void | setKey (std::string key) |
StringMap & | getMetadata (void) |
void | setMetadata (StringMap &metadata) |
+Friends | |
+class | PulsarWrapper |
pulsar::EncryptionKeyInfo::EncryptionKeyInfo | +( | +std::string | key, | +
+ | + | StringMap & | metadata ) | +
EncryptionKeyInfo contains the encryption key and corresponding metadata which contains additional information about the key, such as version and timestamp.
+ +std::string & pulsar::EncryptionKeyInfo::getKey | +( | +) | ++ |
StringMap & pulsar::EncryptionKeyInfo::getMetadata | +( | +void | ) | ++ |
void pulsar::EncryptionKeyInfo::setKey | +( | +std::string | key | ) | ++ |
Set the key of the message for routing policy
+Key | the key of the message for routing policy |
void pulsar::EncryptionKeyInfo::setMetadata | +( | +StringMap & | metadata | ) | ++ |
Set metadata information
+Metadata | the information of metadata |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::FileLoggerFactory, including all inherited members.
+FileLoggerFactory(Logger::Level level, const std::string &logFilePath) | pulsar::FileLoggerFactory | |
getLogger(const std::string &filename) override | pulsar::FileLoggerFactory | virtual |
~FileLoggerFactory() (defined in pulsar::FileLoggerFactory) | pulsar::FileLoggerFactory | |
~LoggerFactory() (defined in pulsar::LoggerFactory) | pulsar::LoggerFactory | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
#include <FileLoggerFactory.h>
+Public Member Functions | |
FileLoggerFactory (Logger::Level level, const std::string &logFilePath) | |
pulsar::Logger * | getLogger (const std::string &filename) override |
Public Member Functions inherited from pulsar::LoggerFactory |
A logger factory that is appending logs to a single file.
+The log format is "yyyy-MM-dd HH:mm:ss,SSS Z <level> <thread-id> <file>:<line> | <msg>", like
+Example:
+pulsar::FileLoggerFactory::FileLoggerFactory | +( | +Logger::Level | level, | +
+ | + | const std::string & | logFilePath ) | +
Create a FileLoggerFactory instance.
+level | the log level |
logFilePath | the log file's path |
+
|
+ +overridevirtual | +
Create a Logger that is created from the filename
+fileName | the filename that is used to construct the Logger |
new
keyword in C++ Implements pulsar::LoggerFactory.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::KeySharedPolicy, including all inherited members.
+clone() const | pulsar::KeySharedPolicy | |
getKeySharedMode() const | pulsar::KeySharedPolicy | |
getStickyRanges() const | pulsar::KeySharedPolicy | |
isAllowOutOfOrderDelivery() const | pulsar::KeySharedPolicy | |
KeySharedPolicy() (defined in pulsar::KeySharedPolicy) | pulsar::KeySharedPolicy | |
KeySharedPolicy(const KeySharedPolicy &) (defined in pulsar::KeySharedPolicy) | pulsar::KeySharedPolicy | |
operator=(const KeySharedPolicy &) (defined in pulsar::KeySharedPolicy) | pulsar::KeySharedPolicy | |
setAllowOutOfOrderDelivery(bool allowOutOfOrderDelivery) | pulsar::KeySharedPolicy | |
setKeySharedMode(KeySharedMode keySharedMode) | pulsar::KeySharedPolicy | |
setStickyRanges(std::initializer_list< StickyRange > ranges) | pulsar::KeySharedPolicy | |
setStickyRanges(const StickyRanges &ranges) | pulsar::KeySharedPolicy | |
~KeySharedPolicy() (defined in pulsar::KeySharedPolicy) | pulsar::KeySharedPolicy |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
+ | KeySharedPolicy (const KeySharedPolicy &) |
+KeySharedPolicy & | operator= (const KeySharedPolicy &) |
KeySharedPolicy | clone () const |
KeySharedPolicy & | setKeySharedMode (KeySharedMode keySharedMode) |
KeySharedMode | getKeySharedMode () const |
KeySharedPolicy & | setAllowOutOfOrderDelivery (bool allowOutOfOrderDelivery) |
bool | isAllowOutOfOrderDelivery () const |
KeySharedPolicy & | setStickyRanges (std::initializer_list< StickyRange > ranges) |
KeySharedPolicy & | setStickyRanges (const StickyRanges &ranges) |
StickyRanges | getStickyRanges () const |
KeySharedPolicy pulsar::KeySharedPolicy::clone | +( | +) | +const | +
Create a new instance of KeySharedPolicy with the same initial settings as the current one.
+ +KeySharedMode pulsar::KeySharedPolicy::getKeySharedMode | +( | +) | +const | +
StickyRanges pulsar::KeySharedPolicy::getStickyRanges | +( | +) | +const | +
bool pulsar::KeySharedPolicy::isAllowOutOfOrderDelivery | +( | +) | +const | +
KeySharedPolicy & pulsar::KeySharedPolicy::setAllowOutOfOrderDelivery | +( | +bool | allowOutOfOrderDelivery | ) | ++ |
If it is enabled, it relaxes the ordering requirement and allows the broker to send out-of-order messages in case of failures. This makes it faster for new consumers to join without being stalled by an existing slow consumer.
+In this case, a single consumer still receives all keys, but they may come in different orders.
+allowOutOfOrderDelivery | whether to allow for out of order delivery |
KeySharedPolicy & pulsar::KeySharedPolicy::setKeySharedMode | +( | +KeySharedMode | keySharedMode | ) | ++ |
Configure the KeyShared mode of KeyShared subscription
+KeyShared | mode |
KeySharedMode
KeySharedPolicy & pulsar::KeySharedPolicy::setStickyRanges | +( | +const StickyRanges & | ranges | ) | ++ |
ranges | used with sticky mode |
KeySharedPolicy & pulsar::KeySharedPolicy::setStickyRanges | +( | +std::initializer_list< StickyRange > | ranges | ) | ++ |
ranges | used with sticky mode |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::KeyValue, including all inherited members.
+getKey() const | pulsar::KeyValue | |
getValue() const | pulsar::KeyValue | |
getValueAsString() const | pulsar::KeyValue | |
getValueLength() const | pulsar::KeyValue | |
KeyValue(std::string &&key, std::string &&value) | pulsar::KeyValue | |
Message (defined in pulsar::KeyValue) | pulsar::KeyValue | friend |
MessageBuilder (defined in pulsar::KeyValue) | pulsar::KeyValue | friend |
+ pulsar-client-cpp
+
+ |
+
#include <KeyValue.h>
+Public Member Functions | |
KeyValue (std::string &&key, std::string &&value) | |
std::string | getKey () const |
const void * | getValue () const |
size_t | getValueLength () const |
std::string | getValueAsString () const |
+Friends | |
+class | Message |
+class | MessageBuilder |
Use to when the user uses key value schema.
+pulsar::KeyValue::KeyValue | +( | +std::string && | key, | +
+ | + | std::string && | value ) | +
Constructor key value, according to keyValueEncodingType, whether key and value be encoded together.
+key | key data. |
value | value data. |
keyValueEncodingType | key value encoding type. |
std::string pulsar::KeyValue::getKey | +( | +) | +const | +
Get the key of KeyValue.
+const void * pulsar::KeyValue::getValue | +( | +) | +const | +
std::string pulsar::KeyValue::getValueAsString | +( | +) | +const | +
size_t pulsar::KeyValue::getValueLength | +( | +) | +const | +
Get the value length of the keyValue.
+
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Logger, including all inherited members.
+isEnabled(Level level)=0 | pulsar::Logger | pure virtual |
Level enum name (defined in pulsar::Logger) | pulsar::Logger | |
LEVEL_DEBUG enum value (defined in pulsar::Logger) | pulsar::Logger | |
LEVEL_ERROR enum value (defined in pulsar::Logger) | pulsar::Logger | |
LEVEL_INFO enum value (defined in pulsar::Logger) | pulsar::Logger | |
LEVEL_WARN enum value (defined in pulsar::Logger) | pulsar::Logger | |
log(Level level, int line, const std::string &message)=0 | pulsar::Logger | pure virtual |
~Logger() (defined in pulsar::Logger) | pulsar::Logger | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
enum | Level { LEVEL_DEBUG = 0 +, LEVEL_INFO = 1 +, LEVEL_WARN = 2 +, LEVEL_ERROR = 3 + } |
+Public Member Functions | |
virtual bool | isEnabled (Level level)=0 |
virtual void | log (Level level, int line, const std::string &message)=0 |
+
|
+ +pure virtual | +
Check whether the log level is enabled
+level | the Logger::Level |
+
|
+ +pure virtual | +
Log the message with related metadata
+level | the Logger::Level |
line | the line number of this log |
message | the message to log |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::LoggerFactory, including all inherited members.
+getLogger(const std::string &fileName)=0 | pulsar::LoggerFactory | pure virtual |
~LoggerFactory() (defined in pulsar::LoggerFactory) | pulsar::LoggerFactory | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual Logger * | getLogger (const std::string &fileName)=0 |
+
|
+ +pure virtual | +
Create a Logger that is created from the filename
+fileName | the filename that is used to construct the Logger |
new
keyword in C++ Implemented in pulsar::ConsoleLoggerFactory, and pulsar::FileLoggerFactory.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Message, including all inherited members.
+BatchAcknowledgementTracker (defined in pulsar::Message) | pulsar::Message | friend |
BatchMessageContainerBase (defined in pulsar::Message) | pulsar::Message | friend |
Commands (defined in pulsar::Message) | pulsar::Message | friend |
ConsumerImpl (defined in pulsar::Message) | pulsar::Message | friend |
getData() const | pulsar::Message | |
getDataAsString() const | pulsar::Message | |
getEventTimestamp() const | pulsar::Message | |
getIndex() const | pulsar::Message | |
getKeyValueData() const | pulsar::Message | |
getLength() const | pulsar::Message | |
getLongSchemaVersion() const | pulsar::Message | |
getMessageId() const | pulsar::Message | |
getOrderingKey() const | pulsar::Message | |
getPartitionKey() const | pulsar::Message | |
getProperties() const | pulsar::Message | |
getProperty(const std::string &name) const | pulsar::Message | |
getPublishTimestamp() const | pulsar::Message | |
getRedeliveryCount() const | pulsar::Message | |
getSchemaVersion() const | pulsar::Message | |
getTopicName() const | pulsar::Message | |
hasOrderingKey() const | pulsar::Message | |
hasPartitionKey() const | pulsar::Message | |
hasProperty(const std::string &name) const | pulsar::Message | |
hasSchemaVersion() const | pulsar::Message | |
impl_ (defined in pulsar::Message) | pulsar::Message | protected |
Message() (defined in pulsar::Message) | pulsar::Message | |
Message(MessageImplPtr &impl) (defined in pulsar::Message) | pulsar::Message | protected |
Message(const MessageId &messageId, proto::BrokerEntryMetadata &brokerEntryMetadata, proto::MessageMetadata &metadata, SharedBuffer &payload) (defined in pulsar::Message) | pulsar::Message | protected |
Message(const MessageId &messageId, proto::BrokerEntryMetadata &brokerEntryMetadata, proto::MessageMetadata &metadata, SharedBuffer &payload, proto::SingleMessageMetadata &singleMetadata, const std::shared_ptr< std::string > &topicName) | pulsar::Message | protected |
MessageBatch (defined in pulsar::Message) | pulsar::Message | friend |
MessageBuilder (defined in pulsar::Message) | pulsar::Message | friend |
MessageImplPtr typedef (defined in pulsar::Message) | pulsar::Message | protected |
MultiTopicsConsumerImpl (defined in pulsar::Message) | pulsar::Message | friend |
operator<< (defined in pulsar::Message) | pulsar::Message | friend |
operator<< (defined in pulsar::Message) | pulsar::Message | friend |
operator==(const Message &msg) const (defined in pulsar::Message) | pulsar::Message | |
OpSendMsg (defined in pulsar::Message) | pulsar::Message | friend |
PartitionedProducerImpl (defined in pulsar::Message) | pulsar::Message | friend |
ProducerImpl (defined in pulsar::Message) | pulsar::Message | friend |
PulsarFriend (defined in pulsar::Message) | pulsar::Message | friend |
PulsarWrapper (defined in pulsar::Message) | pulsar::Message | friend |
setMessageId(const MessageId &messageId) const | pulsar::Message | |
StringMap typedef (defined in pulsar::Message) | pulsar::Message |
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
+typedef std::map< std::string, std::string > | StringMap |
+Public Member Functions | |
const StringMap & | getProperties () const |
bool | hasProperty (const std::string &name) const |
const std::string & | getProperty (const std::string &name) const |
const void * | getData () const |
std::size_t | getLength () const |
std::string | getDataAsString () const |
KeyValue | getKeyValueData () const |
const MessageId & | getMessageId () const |
void | setMessageId (const MessageId &messageId) const |
int64_t | getIndex () const |
const std::string & | getPartitionKey () const |
bool | hasPartitionKey () const |
const std::string & | getOrderingKey () const |
bool | hasOrderingKey () const |
uint64_t | getPublishTimestamp () const |
uint64_t | getEventTimestamp () const |
const std::string & | getTopicName () const |
const int | getRedeliveryCount () const |
bool | hasSchemaVersion () const |
int64_t | getLongSchemaVersion () const |
const std::string & | getSchemaVersion () const |
+bool | operator== (const Message &msg) const |
+Protected Types | |
+typedef std::shared_ptr< MessageImpl > | MessageImplPtr |
+Protected Member Functions | |
+ | Message (MessageImplPtr &impl) |
+ | Message (const MessageId &messageId, proto::BrokerEntryMetadata &brokerEntryMetadata, proto::MessageMetadata &metadata, SharedBuffer &payload) |
+ | Message (const MessageId &messageId, proto::BrokerEntryMetadata &brokerEntryMetadata, proto::MessageMetadata &metadata, SharedBuffer &payload, proto::SingleMessageMetadata &singleMetadata, const std::shared_ptr< std::string > &topicName) |
Used for Batch Messages. | |
+Protected Attributes | |
+MessageImplPtr | impl_ |
+Friends | |
+class | PartitionedProducerImpl |
+class | MultiTopicsConsumerImpl |
+class | MessageBuilder |
+class | ConsumerImpl |
+class | ProducerImpl |
+class | Commands |
+class | BatchMessageContainerBase |
+class | BatchAcknowledgementTracker |
+class | PulsarWrapper |
+class | MessageBatch |
+struct | OpSendMsg |
+class | PulsarFriend |
+PULSAR_PUBLIC std::ostream & | operator<< (std::ostream &s, const StringMap &map) |
+PULSAR_PUBLIC std::ostream & | operator<< (std::ostream &s, const Message &msg) |
const void * pulsar::Message::getData | +( | +) | +const | +
Get the content of the message
+std::string pulsar::Message::getDataAsString | +( | +) | +const | +
Get string representation of the message
+NOTE: For MSVC with debug mode, return a thread local std::string object to avoid memory allocation across DLLs and applications, which could lead to a crash.
+ +uint64_t pulsar::Message::getEventTimestamp | +( | +) | +const | +
Get the event timestamp associated with this message. It is set by the client producer.
+ +int64_t pulsar::Message::getIndex | +( | +) | +const | +
Get the index of this message, if it doesn't exist, return -1
KeyValue pulsar::Message::getKeyValueData | +( | +) | +const | +
Get key value message.
+std::size_t pulsar::Message::getLength | +( | +) | +const | +
Get the length of the message
+int64_t pulsar::Message::getLongSchemaVersion | +( | +) | +const | +
Get the schema version.
+const MessageId & pulsar::Message::getMessageId | +( | +) | +const | +
Get the unique message ID associated with this message.
+The message id can be used to univocally refer to a message without having to keep the entire payload in memory.
+Only messages received from the consumer will have a message id assigned.
+ +const std::string & pulsar::Message::getOrderingKey | +( | +) | +const | +
Get the ordering key of the message
+const std::string & pulsar::Message::getPartitionKey | +( | +) | +const | +
Get the partition key for this message
const StringMap & pulsar::Message::getProperties | +( | +) | +const | +
Return the properties attached to the message. Properties are application defined key/value pairs that will be attached to the message
+const std::string & pulsar::Message::getProperty | +( | +const std::string & | name | ) | +const | +
Get the value of a specific property
+name | the name of the property |
uint64_t pulsar::Message::getPublishTimestamp | +( | +) | +const | +
Get the UTC based timestamp in milliseconds referring to when the message was published by the client producer
+ +const int pulsar::Message::getRedeliveryCount | +( | +) | +const | +
Get the redelivery count for this message
+ +const std::string & pulsar::Message::getSchemaVersion | +( | +) | +const | +
Get the schema version of the raw bytes.
+ +const std::string & pulsar::Message::getTopicName | +( | +) | +const | +
Get the topic Name from which this message originated from
+ +bool pulsar::Message::hasOrderingKey | +( | +) | +const | +
Check whether the message has a ordering key
+bool pulsar::Message::hasPartitionKey | +( | +) | +const | +
bool pulsar::Message::hasProperty | +( | +const std::string & | name | ) | +const | +
Check whether the message has a specific property attached.
+name | the name of the property to check |
bool pulsar::Message::hasSchemaVersion | +( | +) | +const | +
Check if schema version exists
+ +void pulsar::Message::setMessageId | +( | +const MessageId & | messageId | ) | +const | +
Set the unique message ID.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::MessageBatch, including all inherited members.
+MessageBatch() (defined in pulsar::MessageBatch) | pulsar::MessageBatch | |
messages() (defined in pulsar::MessageBatch) | pulsar::MessageBatch | |
parseFrom(const std::string &payload, uint32_t batchSize) (defined in pulsar::MessageBatch) | pulsar::MessageBatch | |
parseFrom(const SharedBuffer &payload, uint32_t batchSize) (defined in pulsar::MessageBatch) | pulsar::MessageBatch | |
withMessageId(const MessageId &messageId) (defined in pulsar::MessageBatch) | pulsar::MessageBatch |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
+MessageBatch & | withMessageId (const MessageId &messageId) |
+MessageBatch & | parseFrom (const std::string &payload, uint32_t batchSize) |
+MessageBatch & | parseFrom (const SharedBuffer &payload, uint32_t batchSize) |
+const std::vector< Message > & | messages () |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::MessageBuilder, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
+typedef std::map< std::string, std::string > | StringMap |
+Public Member Functions | |
Message | build () |
MessageBuilder & | setContent (const void *data, size_t size) |
MessageBuilder & | setContent (const std::string &data) |
MessageBuilder & | setContent (std::string &&data) |
MessageBuilder & | setContent (const KeyValue &data) |
MessageBuilder & | setAllocatedContent (void *data, size_t size) |
MessageBuilder & | setProperty (const std::string &name, const std::string &value) |
MessageBuilder & | setProperties (const StringMap &properties) |
MessageBuilder & | setPartitionKey (const std::string &partitionKey) |
MessageBuilder & | setOrderingKey (const std::string &orderingKey) |
MessageBuilder & | setDeliverAfter (const std::chrono::milliseconds delay) |
MessageBuilder & | setDeliverAt (uint64_t deliveryTimestamp) |
MessageBuilder & | setEventTimestamp (uint64_t eventTimestamp) |
MessageBuilder & | setSequenceId (int64_t sequenceId) |
MessageBuilder & | setReplicationClusters (const std::vector< std::string > &clusters) |
MessageBuilder & | disableReplication (bool flag) |
MessageBuilder & | create () |
+Protected Member Functions | |
+const char * | data () const |
+std::size_t | size () const |
+Friends | |
+class | PulsarWrapper |
Message pulsar::MessageBuilder::build | +( | +) | ++ |
Finalize the immutable message
+ +MessageBuilder & pulsar::MessageBuilder::create | +( | +) | ++ |
create a empty message, with no properties or data
+ +MessageBuilder & pulsar::MessageBuilder::disableReplication | +( | +bool | flag | ) | ++ |
Do not replicate this message
flag | if true, disable replication, otherwise use default replication |
MessageBuilder & pulsar::MessageBuilder::setAllocatedContent | +( | +void * | data, | +
+ | + | size_t | size ) | +
Set content of the message to a buffer already allocated by the caller. No copies of this buffer will be made. The caller is responsible to ensure the memory buffer is valid until the message has been persisted (or an error is returned).
+ +MessageBuilder & pulsar::MessageBuilder::setContent | +( | +const KeyValue & | data | ) | ++ |
Set the key value content of the message
+data | the content of the key value. |
MessageBuilder & pulsar::MessageBuilder::setContent | +( | +const std::string & | data | ) | ++ |
Set the content of the message
+data | the content of the message. |
MessageBuilder & pulsar::MessageBuilder::setContent | +( | +const void * | data, | +
+ | + | size_t | size ) | +
Set content of the message. The given data is copied into message.
+ +MessageBuilder & pulsar::MessageBuilder::setContent | +( | +std::string && | data | ) | ++ |
Set the content of the message
+data | the content of the message. The given data is moved into message. |
MessageBuilder & pulsar::MessageBuilder::setDeliverAfter | +( | +const std::chrono::milliseconds | delay | ) | ++ |
Specify a delay for the delivery of the messages.
+delay | the delay in milliseconds |
MessageBuilder & pulsar::MessageBuilder::setDeliverAt | +( | +uint64_t | deliveryTimestamp | ) | ++ |
Specify the this message should not be delivered earlier than the specified timestamp.
+deliveryTimestamp | UTC based timestamp in milliseconds |
MessageBuilder & pulsar::MessageBuilder::setEventTimestamp | +( | +uint64_t | eventTimestamp | ) | ++ |
Set the event timestamp for the message.
+ +MessageBuilder & pulsar::MessageBuilder::setOrderingKey | +( | +const std::string & | orderingKey | ) | ++ |
set ordering key used for key_shared subscriptions
the | ordering key for the message |
MessageBuilder & pulsar::MessageBuilder::setPartitionKey | +( | +const std::string & | partitionKey | ) | ++ |
set partition key for message routing and topic compaction
hash | of this key is used to determine message's topic partition |
MessageBuilder & pulsar::MessageBuilder::setProperties | +( | +const StringMap & | properties | ) | ++ |
Add all the properties in the provided map
+ +MessageBuilder & pulsar::MessageBuilder::setProperty | +( | +const std::string & | name, | +
+ | + | const std::string & | value ) | +
Sets a new property on a message.
name | the name of the property |
value | the associated value |
MessageBuilder & pulsar::MessageBuilder::setReplicationClusters | +( | +const std::vector< std::string > & | clusters | ) | ++ |
override namespace replication clusters. note that it is the caller's responsibility to provide valid cluster names, and that all clusters have been previously configured as topics.
+given an empty list, the message will replicate per the namespace configuration.
+clusters | where to send this message. |
MessageBuilder & pulsar::MessageBuilder::setSequenceId | +( | +int64_t | sequenceId | ) | ++ |
Specify a custom sequence id for the message being published.
+The sequence id can be used for deduplication purposes and it needs to follow these rules:
sequenceId >= 0
sequenceId(N+1) > sequenceId(N)
sequenceId
could represent an offset or a cumulative size. sequenceId | the sequence id to assign to the current message |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::MessageId, including all inherited members.
+BatchAcknowledgementTracker (defined in pulsar::MessageId) | pulsar::MessageId | friend |
batchIndex() const (defined in pulsar::MessageId) | pulsar::MessageId | |
batchSize() const (defined in pulsar::MessageId) | pulsar::MessageId | |
ChunkMessageIdImpl (defined in pulsar::MessageId) | pulsar::MessageId | friend |
Commands (defined in pulsar::MessageId) | pulsar::MessageId | friend |
ConsumerImpl (defined in pulsar::MessageId) | pulsar::MessageId | friend |
deserialize(const std::string &serializedMessageId) | pulsar::MessageId | static |
earliest() | pulsar::MessageId | static |
entryId() const (defined in pulsar::MessageId) | pulsar::MessageId | |
getTopicName() const | pulsar::MessageId | |
latest() | pulsar::MessageId | static |
ledgerId() const (defined in pulsar::MessageId) | pulsar::MessageId | |
Message (defined in pulsar::MessageId) | pulsar::MessageId | friend |
MessageId() (defined in pulsar::MessageId) | pulsar::MessageId | |
MessageId(int32_t partition, int64_t ledgerId, int64_t entryId, int32_t batchIndex) | pulsar::MessageId | explicit |
MessageIdBuilder (defined in pulsar::MessageId) | pulsar::MessageId | friend |
MessageImpl (defined in pulsar::MessageId) | pulsar::MessageId | friend |
MultiTopicsConsumerImpl (defined in pulsar::MessageId) | pulsar::MessageId | friend |
NegativeAcksTracker (defined in pulsar::MessageId) | pulsar::MessageId | friend |
operator!=(const MessageId &other) const (defined in pulsar::MessageId) | pulsar::MessageId | |
operator<(const MessageId &other) const (defined in pulsar::MessageId) | pulsar::MessageId | |
operator<< (defined in pulsar::MessageId) | pulsar::MessageId | friend |
operator<=(const MessageId &other) const (defined in pulsar::MessageId) | pulsar::MessageId | |
operator=(const MessageId &) (defined in pulsar::MessageId) | pulsar::MessageId | |
operator==(const MessageId &other) const (defined in pulsar::MessageId) | pulsar::MessageId | |
operator>(const MessageId &other) const (defined in pulsar::MessageId) | pulsar::MessageId | |
operator>=(const MessageId &other) const (defined in pulsar::MessageId) | pulsar::MessageId | |
partition() const (defined in pulsar::MessageId) | pulsar::MessageId | |
PartitionedProducerImpl (defined in pulsar::MessageId) | pulsar::MessageId | friend |
PulsarFriend (defined in pulsar::MessageId) | pulsar::MessageId | friend |
PulsarWrapper (defined in pulsar::MessageId) | pulsar::MessageId | friend |
ReaderImpl (defined in pulsar::MessageId) | pulsar::MessageId | friend |
serialize(std::string &result) const | pulsar::MessageId | |
setTopicName(const std::string &topicName) | pulsar::MessageId | |
UnAckedMessageTrackerEnabled (defined in pulsar::MessageId) | pulsar::MessageId | friend |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
+MessageId & | operator= (const MessageId &) |
MessageId (int32_t partition, int64_t ledgerId, int64_t entryId, int32_t batchIndex) | |
void | serialize (std::string &result) const |
const std::string & | getTopicName () const |
void | setTopicName (const std::string &topicName) |
+bool | operator< (const MessageId &other) const |
+bool | operator<= (const MessageId &other) const |
+bool | operator> (const MessageId &other) const |
+bool | operator>= (const MessageId &other) const |
+bool | operator== (const MessageId &other) const |
+bool | operator!= (const MessageId &other) const |
+int64_t | ledgerId () const |
+int64_t | entryId () const |
+int32_t | batchIndex () const |
+int32_t | partition () const |
+int32_t | batchSize () const |
+Static Public Member Functions | |
static const MessageId & | earliest () |
static const MessageId & | latest () |
static MessageId | deserialize (const std::string &serializedMessageId) |
+Friends | |
+class | ConsumerImpl |
+class | ReaderImpl |
+class | Message |
+class | MessageImpl |
+class | Commands |
+class | PartitionedProducerImpl |
+class | MultiTopicsConsumerImpl |
+class | UnAckedMessageTrackerEnabled |
+class | BatchAcknowledgementTracker |
+class | PulsarWrapper |
+class | PulsarFriend |
+class | NegativeAcksTracker |
+class | MessageIdBuilder |
+class | ChunkMessageIdImpl |
+PULSAR_PUBLIC std::ostream & | operator<< (std::ostream &s, const MessageId &messageId) |
+
|
+ +explicit | +
Construct the MessageId
+NOTE: This API still exists for backward compatibility, use MessageIdBuilder instead.
+partition | the partition number of a topic |
ledgerId | the ledger id |
entryId | the entry id |
batchIndex | the batch index of a single message in a batch |
+
|
+ +static | +
Deserialize a message id from a binary string
+ +
+
|
+ +static | +
MessageId representing the "earliest" or "oldest available" message stored in the topic
+ +const std::string & pulsar::MessageId::getTopicName | +( | +) | +const | +
Get the topic Name from which this message originated from
+
+
|
+ +static | +
MessageId representing the "latest" or "last published" message in the topic
+ +void pulsar::MessageId::serialize | +( | +std::string & | result | ) | +const | +
Serialize the message id into a binary string for storing
+ +void pulsar::MessageId::setTopicName | +( | +const std::string & | topicName | ) | ++ |
Set the topicName
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::MessageIdBuilder, including all inherited members.
+batchIndex(int32_t batchIndex) | pulsar::MessageIdBuilder | |
batchSize(int32_t batchSize) | pulsar::MessageIdBuilder | |
build() const | pulsar::MessageIdBuilder | |
entryId(int64_t entryId) | pulsar::MessageIdBuilder | |
from(const MessageId &messageId) | pulsar::MessageIdBuilder | static |
from(const proto::MessageIdData &messageIdData) | pulsar::MessageIdBuilder | static |
ledgerId(int64_t ledgerId) | pulsar::MessageIdBuilder | |
MessageIdBuilder() (defined in pulsar::MessageIdBuilder) | pulsar::MessageIdBuilder | explicit |
partition(int32_t partition) | pulsar::MessageIdBuilder |
+ pulsar-client-cpp
+
+ |
+
#include <MessageIdBuilder.h>
+Public Member Functions | |
MessageId | build () const |
MessageIdBuilder & | ledgerId (int64_t ledgerId) |
MessageIdBuilder & | entryId (int64_t entryId) |
MessageIdBuilder & | partition (int32_t partition) |
MessageIdBuilder & | batchIndex (int32_t batchIndex) |
MessageIdBuilder & | batchSize (int32_t batchSize) |
+Static Public Member Functions | |
static MessageIdBuilder | from (const MessageId &messageId) |
static MessageIdBuilder | from (const proto::MessageIdData &messageIdData) |
The builder to build a MessageId.
+Example of building a single MessageId:
+Example of building a batched MessageId:
+MessageIdBuilder & pulsar::MessageIdBuilder::batchIndex | +( | +int32_t | batchIndex | ) | ++ |
Set the batch index.
+Default: -1
+ +MessageIdBuilder & pulsar::MessageIdBuilder::batchSize | +( | +int32_t | batchSize | ) | ++ |
Set the batch size.
+Default: 0
+ +MessageIdBuilder & pulsar::MessageIdBuilder::entryId | +( | +int64_t | entryId | ) | ++ |
Set the entry ID field.
+Default: -1L
+ +
+
|
+ +static | +
Create an instance that copies the data from messageId.
+ +
+
|
+ +static | +
Create an instance from the proto::MessageIdData instance.
+MessageIdBuilder & pulsar::MessageIdBuilder::ledgerId | +( | +int64_t | ledgerId | ) | ++ |
Set the ledger ID field.
+Default: -1L
+ +MessageIdBuilder & pulsar::MessageIdBuilder::partition | +( | +int32_t | partition | ) | ++ |
Set the partition index.
+Default: -1
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::MessageRoutingPolicy, including all inherited members.
+getPartition(const Message &msg) | pulsar::MessageRoutingPolicy | inlinevirtual |
getPartition(const Message &msg, const TopicMetadata &topicMetadata) | pulsar::MessageRoutingPolicy | inlinevirtual |
~MessageRoutingPolicy() (defined in pulsar::MessageRoutingPolicy) | pulsar::MessageRoutingPolicy | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual int | getPartition (const Message &msg) |
virtual int | getPartition (const Message &msg, const TopicMetadata &topicMetadata) |
+
|
+ +inlinevirtual | +
+
|
+ +inlinevirtual | +
Choose the partition from the message and topic metadata
+message | the Message |
topicMetadata | the TopicMetadata that contains the partition number |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Oauth2Flow, including all inherited members.
+authenticate()=0 | pulsar::Oauth2Flow | pure virtual |
close()=0 | pulsar::Oauth2Flow | pure virtual |
initialize()=0 | pulsar::Oauth2Flow | pure virtual |
Oauth2Flow() (defined in pulsar::Oauth2Flow) | pulsar::Oauth2Flow | protected |
~Oauth2Flow() (defined in pulsar::Oauth2Flow) | pulsar::Oauth2Flow | virtual |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
virtual void | initialize ()=0 |
virtual Oauth2TokenResultPtr | authenticate ()=0 |
virtual void | close ()=0 |
+
|
+ +pure virtual | +
Acquires an access token from the OAuth 2.0 authorization server.
+
|
+ +pure virtual | +
Closes the authorization flow.
+ +
+
|
+ +pure virtual | +
Initializes the authorization flow.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Oauth2TokenResult, including all inherited members.
+getAccessToken() const | pulsar::Oauth2TokenResult | |
getExpiresIn() const | pulsar::Oauth2TokenResult | |
getIdToken() const | pulsar::Oauth2TokenResult | |
getRefreshToken() const | pulsar::Oauth2TokenResult | |
Oauth2TokenResult() (defined in pulsar::Oauth2TokenResult) | pulsar::Oauth2TokenResult | |
setAccessToken(const std::string &accessToken) | pulsar::Oauth2TokenResult | |
setExpiresIn(const int64_t expiresIn) | pulsar::Oauth2TokenResult | |
setIdToken(const std::string &idToken) | pulsar::Oauth2TokenResult | |
setRefreshToken(const std::string &refreshToken) | pulsar::Oauth2TokenResult | |
undefined_expiration enum value (defined in pulsar::Oauth2TokenResult) | pulsar::Oauth2TokenResult | |
~Oauth2TokenResult() (defined in pulsar::Oauth2TokenResult) | pulsar::Oauth2TokenResult |
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
enum | { undefined_expiration = -1 + } |
+Public Member Functions | |
Oauth2TokenResult & | setAccessToken (const std::string &accessToken) |
Oauth2TokenResult & | setIdToken (const std::string &idToken) |
Oauth2TokenResult & | setRefreshToken (const std::string &refreshToken) |
Oauth2TokenResult & | setExpiresIn (const int64_t expiresIn) |
const std::string & | getAccessToken () const |
const std::string & | getIdToken () const |
const std::string & | getRefreshToken () const |
int64_t | getExpiresIn () const |
const std::string & pulsar::Oauth2TokenResult::getAccessToken | +( | +) | +const | +
int64_t pulsar::Oauth2TokenResult::getExpiresIn | +( | +) | +const | +
const std::string & pulsar::Oauth2TokenResult::getIdToken | +( | +) | +const | +
const std::string & pulsar::Oauth2TokenResult::getRefreshToken | +( | +) | +const | +
Oauth2TokenResult & pulsar::Oauth2TokenResult::setAccessToken | +( | +const std::string & | accessToken | ) | ++ |
Set the access token string
+accessToken | the access token string |
Oauth2TokenResult & pulsar::Oauth2TokenResult::setExpiresIn | +( | +const int64_t | expiresIn | ) | ++ |
Set the token lifetime
+expiresIn | the token lifetime |
Oauth2TokenResult & pulsar::Oauth2TokenResult::setIdToken | +( | +const std::string & | idToken | ) | ++ |
Set the ID token
+idToken | the ID token |
Oauth2TokenResult & pulsar::Oauth2TokenResult::setRefreshToken | +( | +const std::string & | refreshToken | ) | ++ |
Set the refresh token which can be used to obtain new access tokens using the same authorization grant or null for none
+refreshToken | the refresh token |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Producer, including all inherited members.
+ClientImpl (defined in pulsar::Producer) | pulsar::Producer | friend |
close() | pulsar::Producer | |
closeAsync(CloseCallback callback) | pulsar::Producer | |
flush() | pulsar::Producer | |
flushAsync(FlushCallback callback) | pulsar::Producer | |
getLastSequenceId() const | pulsar::Producer | |
getProducerName() const | pulsar::Producer | |
getSchemaVersion() const | pulsar::Producer | |
getTopic() const | pulsar::Producer | |
isConnected() const | pulsar::Producer | |
Producer() | pulsar::Producer | |
ProducerImpl (defined in pulsar::Producer) | pulsar::Producer | friend |
PulsarFriend (defined in pulsar::Producer) | pulsar::Producer | friend |
PulsarWrapper (defined in pulsar::Producer) | pulsar::Producer | friend |
send(const Message &msg) | pulsar::Producer | |
send(const Message &msg, MessageId &messageId) | pulsar::Producer | |
sendAsync(const Message &msg, SendCallback callback) | pulsar::Producer |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
Producer () | |
const std::string & | getTopic () const |
const std::string & | getProducerName () const |
Result | send (const Message &msg) |
Result | send (const Message &msg, MessageId &messageId) |
void | sendAsync (const Message &msg, SendCallback callback) |
Result | flush () |
void | flushAsync (FlushCallback callback) |
int64_t | getLastSequenceId () const |
const std::string & | getSchemaVersion () const |
Result | close () |
void | closeAsync (CloseCallback callback) |
bool | isConnected () const |
+Friends | |
+class | ClientImpl |
+class | PulsarFriend |
+class | PulsarWrapper |
+class | ProducerImpl |
pulsar::Producer::Producer | +( | +) | ++ |
Construct an uninitialized Producer.
+ +Result pulsar::Producer::close | +( | +) | ++ |
Close the producer and release resources allocated.
+No more writes will be accepted from this producer. Waits until all pending write requests are persisted. In case of errors, pending writes will not be retried.
+void pulsar::Producer::closeAsync | +( | +CloseCallback | callback | ) | ++ |
Close the producer and release resources allocated.
+No more writes will be accepted from this producer. The provided callback will be triggered when all pending write requests are persisted. In case of errors, pending writes will not be retried.
+ +Result pulsar::Producer::flush | +( | +) | ++ |
Flush all the messages buffered in the client and wait until all messages have been successfully persisted.
+ +void pulsar::Producer::flushAsync | +( | +FlushCallback | callback | ) | ++ |
Flush all the messages buffered in the client and wait until all messages have been successfully persisted.
+ +int64_t pulsar::Producer::getLastSequenceId | +( | +) | +const | +
Get the last sequence id that was published by this producer.
+This represent either the automatically assigned or custom sequence id (set on the MessageBuilder) that was published and acknowledged by the broker.
+After recreating a producer with the same producer name, this will return the last message that was published in the previous producer session, or -1 if there no message was ever published.
+const std::string & pulsar::Producer::getProducerName | +( | +) | +const | +
const std::string & pulsar::Producer::getSchemaVersion | +( | +) | +const | +
Return an identifier for the schema version that this producer was created with.
+When the producer is created, if a schema info was passed, the broker will determine the version of the passed schema. This identifier should be treated as an opaque identifier. In particular, even though this is represented as a string, the version might not be ascii printable.
+ +const std::string & pulsar::Producer::getTopic | +( | +) | +const | +
bool pulsar::Producer::isConnected | +( | +) | +const | +
msg
though msg
is const
. Result pulsar::Producer::send | +( | +const Message & | msg, | +
+ | + | MessageId & | messageId ) | +
Publish a message on the topic associated with this Producer and get the associated MessageId.
+This method will block until the message will be accepted and persisted by the broker. In case of errors, the client library will try to automatically recover and use a different broker.
+If it wasn't possible to successfully publish the message within the sendTimeout, an error will be returned.
+This method is equivalent to asyncSend() and wait until the callback is triggered.
+[in] | msg | message to publish |
[out] | messageId | the message id assigned to the published message |
void pulsar::Producer::sendAsync | +( | +const Message & | msg, | +
+ | + | SendCallback | callback ) | +
Asynchronously publish a message on the topic associated with this Producer.
+This method will initiate the publish operation and return immediately. The provided callback will be triggered when the message has been be accepted and persisted by the broker. In case of errors, the client library will try to automatically recover and use a different broker.
+If it wasn't possible to successfully publish the message within the sendTimeout, the callback will be triggered with a Result::WriteError code.
+msg | message to publish |
callback | the callback to get notification of the completion |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ProducerConfiguration, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
#include <ProducerConfiguration.h>
+Public Types | |
enum | PartitionsRoutingMode { UseSinglePartition +, RoundRobinDistribution +, CustomPartition + } |
enum | HashingScheme { Murmur3_32Hash +, BoostHash +, JavaStringHash + } |
enum | BatchingType { DefaultBatching +, KeyBasedBatching + } |
enum | ProducerAccessMode { Shared = 0 +, Exclusive = 1 +, WaitForExclusive = 2 +, ExclusiveWithFencing = 3 + } |
+Public Member Functions | |
+ | ProducerConfiguration (const ProducerConfiguration &) |
+ProducerConfiguration & | operator= (const ProducerConfiguration &) |
ProducerConfiguration & | setProducerName (const std::string &producerName) |
const std::string & | getProducerName () const |
ProducerConfiguration & | setSchema (const SchemaInfo &schemaInfo) |
const SchemaInfo & | getSchema () const |
ProducerConfiguration & | setSendTimeout (int sendTimeoutMs) |
int | getSendTimeout () const |
ProducerConfiguration & | setInitialSequenceId (int64_t initialSequenceId) |
int64_t | getInitialSequenceId () const |
ProducerConfiguration & | setCompressionType (CompressionType compressionType) |
CompressionType | getCompressionType () const |
ProducerConfiguration & | setMaxPendingMessages (int maxPendingMessages) |
int | getMaxPendingMessages () const |
ProducerConfiguration & | setMaxPendingMessagesAcrossPartitions (int maxPendingMessagesAcrossPartitions) |
int | getMaxPendingMessagesAcrossPartitions () const |
ProducerConfiguration & | setPartitionsRoutingMode (const PartitionsRoutingMode &mode) |
PartitionsRoutingMode | getPartitionsRoutingMode () const |
ProducerConfiguration & | setMessageRouter (const MessageRoutingPolicyPtr &router) |
const MessageRoutingPolicyPtr & | getMessageRouterPtr () const |
ProducerConfiguration & | setHashingScheme (const HashingScheme &scheme) |
HashingScheme | getHashingScheme () const |
ProducerConfiguration & | setLazyStartPartitionedProducers (bool) |
bool | getLazyStartPartitionedProducers () const |
ProducerConfiguration & | setBlockIfQueueFull (bool) |
bool | getBlockIfQueueFull () const |
ProducerConfiguration & | setBatchingEnabled (const bool &batchingEnabled) |
const bool & | getBatchingEnabled () const |
ProducerConfiguration & | setBatchingMaxMessages (const unsigned int &batchingMaxMessages) |
const unsigned int & | getBatchingMaxMessages () const |
ProducerConfiguration & | setBatchingMaxAllowedSizeInBytes (const unsigned long &batchingMaxAllowedSizeInBytes) |
const unsigned long & | getBatchingMaxAllowedSizeInBytes () const |
ProducerConfiguration & | setBatchingMaxPublishDelayMs (const unsigned long &batchingMaxPublishDelayMs) |
const unsigned long & | getBatchingMaxPublishDelayMs () const |
ProducerConfiguration & | setBatchingType (BatchingType batchingType) |
BatchingType | getBatchingType () const |
const CryptoKeyReaderPtr | getCryptoKeyReader () const |
ProducerConfiguration & | setCryptoKeyReader (CryptoKeyReaderPtr cryptoKeyReader) |
ProducerCryptoFailureAction | getCryptoFailureAction () const |
ProducerConfiguration & | setCryptoFailureAction (ProducerCryptoFailureAction action) |
const std::set< std::string > & | getEncryptionKeys () const |
bool | isEncryptionEnabled () const |
ProducerConfiguration & | addEncryptionKey (std::string key) |
bool | hasProperty (const std::string &name) const |
const std::string & | getProperty (const std::string &name) const |
std::map< std::string, std::string > & | getProperties () const |
ProducerConfiguration & | setProperty (const std::string &name, const std::string &value) |
ProducerConfiguration & | setProperties (const std::map< std::string, std::string > &properties) |
ProducerConfiguration & | setChunkingEnabled (bool chunkingEnabled) |
bool | isChunkingEnabled () const |
ProducerConfiguration & | setAccessMode (const ProducerAccessMode &accessMode) |
ProducerAccessMode | getAccessMode () const |
+ProducerConfiguration & | intercept (const std::vector< ProducerInterceptorPtr > &interceptors) |
+const std::vector< ProducerInterceptorPtr > & | getInterceptors () const |
+Friends | |
+class | PulsarWrapper |
+class | ConsumerImpl |
+class | ProducerImpl |
Class that holds the configuration for a producer
+enum pulsar::ProducerConfiguration::BatchingType | +
enum pulsar::ProducerConfiguration::ProducerAccessMode | +
Enumerator | |
---|---|
Shared | By default multiple producers can publish on a topic. + |
Exclusive | Require exclusive access for producer. Fail immediately if there's already a producer connected. + |
WaitForExclusive | Producer creation is pending until it can acquire exclusive access. + |
ExclusiveWithFencing | Acquire exclusive access for the producer. Any existing producer will be removed and invalidated immediately. + |
ProducerConfiguration & pulsar::ProducerConfiguration::addEncryptionKey | +( | +std::string | key | ) | ++ |
Add public encryption key, used by producer to encrypt the data key.
+At the time of producer creation, Pulsar client checks if there are keys added to encryptionKeys. If keys are found, a callback getKey(String keyName) is invoked against each key to load the values of the key. Application should implement this callback to return the key in pkcs8 format. If compression is enabled, message is encrypted after compression. If batch messaging is enabled, the batched message is encrypted.
+@key the encryption key to add
ProducerAccessMode pulsar::ProducerConfiguration::getAccessMode | +( | +) | +const | +
Get the type of access mode that the producer requires on the topic.
+ +const bool & pulsar::ProducerConfiguration::getBatchingEnabled | +( | +) | +const | +
Return the flag whether automatic message batching is enabled or not for the producer.
+const unsigned long & pulsar::ProducerConfiguration::getBatchingMaxAllowedSizeInBytes | +( | +) | +const | +
The getter associated with setBatchingMaxAllowedSizeInBytes().
+ +const unsigned int & pulsar::ProducerConfiguration::getBatchingMaxMessages | +( | +) | +const | +
The getter associated with setBatchingMaxMessages().
+ +const unsigned long & pulsar::ProducerConfiguration::getBatchingMaxPublishDelayMs | +( | +) | +const | +
The getter associated with setBatchingMaxPublishDelayMs().
+ +BatchingType pulsar::ProducerConfiguration::getBatchingType | +( | +) | +const | +
bool pulsar::ProducerConfiguration::getBlockIfQueueFull | +( | +) | +const | +
CompressionType pulsar::ProducerConfiguration::getCompressionType | +( | +) | +const | +
The getter associated with setCompressionType().
+ +ProducerCryptoFailureAction pulsar::ProducerConfiguration::getCryptoFailureAction | +( | +) | +const | +
The getter associated with setCryptoFailureAction().
+ +const CryptoKeyReaderPtr pulsar::ProducerConfiguration::getCryptoKeyReader | +( | +) | +const | +
The getter associated with setCryptoKeyReader().
+ +const std::set< std::string > & pulsar::ProducerConfiguration::getEncryptionKeys | +( | +) | +const | +
HashingScheme pulsar::ProducerConfiguration::getHashingScheme | +( | +) | +const | +
The getter associated with setHashingScheme().
+ +int64_t pulsar::ProducerConfiguration::getInitialSequenceId | +( | +) | +const | +
The getter associated with setInitialSequenceId().
+ +bool pulsar::ProducerConfiguration::getLazyStartPartitionedProducers | +( | +) | +const | +
The getter associated with setLazyStartPartitionedProducers()
+ +int pulsar::ProducerConfiguration::getMaxPendingMessages | +( | +) | +const | +
The getter associated with setMaxPendingMessages().
+ +int pulsar::ProducerConfiguration::getMaxPendingMessagesAcrossPartitions | +( | +) | +const | +
const MessageRoutingPolicyPtr & pulsar::ProducerConfiguration::getMessageRouterPtr | +( | +) | +const | +
The getter associated with setMessageRouter().
+ +PartitionsRoutingMode pulsar::ProducerConfiguration::getPartitionsRoutingMode | +( | +) | +const | +
The getter associated with setPartitionsRoutingMode().
+ +const std::string & pulsar::ProducerConfiguration::getProducerName | +( | +) | +const | +
The getter associated with setProducerName().
+ +std::map< std::string, std::string > & pulsar::ProducerConfiguration::getProperties | +( | +) | +const | +
Get all the properties attached to this producer.
+ +const std::string & pulsar::ProducerConfiguration::getProperty | +( | +const std::string & | name | ) | +const | +
Get the value of a specific property
+name | the name of the property |
const SchemaInfo & pulsar::ProducerConfiguration::getSchema | +( | +) | +const | +
int pulsar::ProducerConfiguration::getSendTimeout | +( | +) | +const | +
Get the send timeout is milliseconds.
+If a message is not acknowledged by the server before the sendTimeout expires, an error will be reported.
+If the timeout is zero, there will be no timeout.
+bool pulsar::ProducerConfiguration::hasProperty | +( | +const std::string & | name | ) | +const | +
Check whether the producer has a specific property attached.
+name | the name of the property to check |
bool pulsar::ProducerConfiguration::isChunkingEnabled | +( | +) | +const | +
The getter associated with setChunkingEnabled().
+ +bool pulsar::ProducerConfiguration::isEncryptionEnabled | +( | +) | +const | +
ProducerConfiguration & pulsar::ProducerConfiguration::setAccessMode | +( | +const ProducerAccessMode & | accessMode | ) | ++ |
Set the type of access mode that the producer requires on the topic.
+accessMode | The type of access to the topic that the producer requires |
ProducerConfiguration & pulsar::ProducerConfiguration::setBatchingEnabled | +( | +const bool & | batchingEnabled | ) | ++ |
Control whether automatic batching of messages is enabled or not for the producer.
+Default: true
+When automatic batching is enabled, multiple calls to Producer::sendAsync can result in a single batch to be sent to the broker, leading to better throughput, especially when publishing small messages. If compression is enabled, messages are compressed at the batch level, leading to a much better compression ratio for similar headers or contents.
+When the default batch delay is set to 10 ms and the default batch size is 1000 messages.
+ + +ProducerConfiguration & pulsar::ProducerConfiguration::setBatchingMaxAllowedSizeInBytes | +( | +const unsigned long & | batchingMaxAllowedSizeInBytes | ) | ++ |
Set the max size of messages permitted in a batch. Default value: 128 KB. If you set this option to a value greater than 1, messages are queued until this threshold is reached or batch interval has elapsed.
+All messages in a batch are published as a single batch message. The consumer is delivered individual messages in the batch in the same order they are enqueued.
+batchingMaxAllowedSizeInBytes |
ProducerConfiguration & pulsar::ProducerConfiguration::setBatchingMaxMessages | +( | +const unsigned int & | batchingMaxMessages | ) | ++ |
Set the max number of messages permitted in a batch. Default value: 1000. If you set this option to a value greater than 1, messages are queued until this threshold is reached or batch interval has elapsed.
+All messages in a batch are published as a single batch message. The consumer is delivered individual messages in the batch in the same order they are enqueued.
batchMessagesMaxMessagesPerBatch | max number of messages permitted in a batch |
ProducerConfiguration & pulsar::ProducerConfiguration::setBatchingMaxPublishDelayMs | +( | +const unsigned long & | batchingMaxPublishDelayMs | ) | ++ |
Set the max time for message publish delay permitted in a batch. Default value: 10 ms.
+batchingMaxPublishDelayMs | max time for message publish delay permitted in a batch. |
ProducerConfiguration & pulsar::ProducerConfiguration::setBatchingType | +( | +BatchingType | batchingType | ) | ++ |
Default: DefaultBatching
+ProducerConfiguration & pulsar::ProducerConfiguration::setBlockIfQueueFull | +( | +bool | ) | ++ |
The setter associated with getBlockIfQueueFull()
+ +ProducerConfiguration & pulsar::ProducerConfiguration::setChunkingEnabled | +( | +bool | chunkingEnabled | ) | ++ |
If message size is higher than allowed max publish-payload size by broker then enableChunking helps producer to split message into multiple chunks and publish them to broker separately in order. So, it allows client to successfully publish large size of messages in pulsar.
+Set it true to enable this feature. If so, you must disable batching (see setBatchingEnabled), otherwise the producer creation will fail.
+There are some other recommendations when it's enabled:
Default: false
+chunkingEnabled | whether chunking is enabled |
ProducerConfiguration & pulsar::ProducerConfiguration::setCompressionType | +( | +CompressionType | compressionType | ) | ++ |
Set the compression type for the producer.
+By default, message payloads are not compressed. Supported compression types are:
CompressionNone
: No compression CompressionLZ4
: LZ4 Compression https://lz4.github.io/lz4/ CompressionZLib
: ZLib Compression http://zlib.net/ CompressionZSTD
: Zstandard Compression https://facebook.github.io/zstd/ (Since Pulsar 2.3. Zstd cannot be used if consumer applications are not in version >= 2.3 as well) CompressionSNAPPY
: Snappy Compression https://google.github.io/snappy/ (Since Pulsar 2.4. Snappy cannot be used if consumer applications are not in version >= 2.4 as well) ProducerConfiguration & pulsar::ProducerConfiguration::setCryptoFailureAction | +( | +ProducerCryptoFailureAction | action | ) | ++ |
Sets the ProducerCryptoFailureAction to the value specified.
+action | the action taken by the producer in case of encryption failures. |
ProducerConfiguration & pulsar::ProducerConfiguration::setCryptoKeyReader | +( | +CryptoKeyReaderPtr | cryptoKeyReader | ) | ++ |
Set the shared pointer to CryptoKeyReader.
+shared | pointer to CryptoKeyReader. |
ProducerConfiguration & pulsar::ProducerConfiguration::setHashingScheme | +( | +const HashingScheme & | scheme | ) | ++ |
Set the hashing scheme, which is a standard hashing function available when choosing the partition used for a particular message.
+Default: HashingScheme::BoostHash
+Standard hashing functions available are:
HashingScheme::JavaStringHash
: Java String.hashCode()
(Default). HashingScheme::BoostHash
: Use Boost hashing function. HashingScheme::Murmur3_32Hash
: Use [Murmur3 hashing function](https://en.wikipedia.org/wiki/MurmurHash"). scheme | hashing scheme. |
ProducerConfiguration & pulsar::ProducerConfiguration::setInitialSequenceId | +( | +int64_t | initialSequenceId | ) | ++ |
Set the baseline of the sequence ID for messages published by the producer.
+The first message uses (initialSequenceId + 1) as its sequence ID and subsequent messages are assigned incremental sequence IDs.
+Default: -1, which means the first message's sequence ID is 0.
+initialSequenceId | the initial sequence ID for the producer. |
ProducerConfiguration & pulsar::ProducerConfiguration::setLazyStartPartitionedProducers | +( | +bool | ) | ++ |
This config affects producers of partitioned topics only. It controls whether producers register and connect immediately to the owner broker of each partition or start lazily on demand. The internal producer of one partition is always started eagerly, chosen by the routing policy, but the internal producers of any additional partitions are started on demand, upon receiving their first message. Using this mode can reduce the strain on brokers for topics with large numbers of partitions and when the SinglePartition routing policy is used without keyed messages. Because producer connection can be on demand, this can produce extra send latency for the first messages of a given partition.
true/false | as to whether to start partition producers lazily |
ProducerConfiguration & pulsar::ProducerConfiguration::setMaxPendingMessages | +( | +int | maxPendingMessages | ) | ++ |
Set the max size of the queue holding the messages pending to receive an acknowledgment from the broker.
+When the queue is full, by default, all calls to Producer::send and Producer::sendAsync would fail unless blockIfQueueFull is set to true. Use setBlockIfQueueFull
to change the blocking behavior.
Default: 1000
+maxPendingMessages | max number of pending messages. |
ProducerConfiguration & pulsar::ProducerConfiguration::setMaxPendingMessagesAcrossPartitions | +( | +int | maxPendingMessagesAcrossPartitions | ) | ++ |
Set the number of max pending messages across all the partitions
+This setting will be used to lower the max pending messages for each partition (setMaxPendingMessages(int)
), if the total exceeds the configured value.
Default: 50000
+maxPendingMessagesAcrossPartitions |
ProducerConfiguration & pulsar::ProducerConfiguration::setMessageRouter | +( | +const MessageRoutingPolicyPtr & | router | ) | ++ |
Set a custom message routing policy by passing an implementation of MessageRouter.
+messageRouter | message router. |
ProducerConfiguration & pulsar::ProducerConfiguration::setPartitionsRoutingMode | +( | +const PartitionsRoutingMode & | mode | ) | ++ |
Set the message routing modes for partitioned topics.
+Default: UseSinglePartition
+PartitionsRoutingMode | partition routing mode. |
ProducerConfiguration & pulsar::ProducerConfiguration::setProducerName | +( | +const std::string & | producerName | ) | ++ |
Set the producer name which could be assigned by the system or specified by the client.
+producerName | producer name. |
ProducerConfiguration & pulsar::ProducerConfiguration::setProperties | +( | +const std::map< std::string, std::string > & | properties | ) | ++ |
Add all the properties in the provided map
+ +ProducerConfiguration & pulsar::ProducerConfiguration::setProperty | +( | +const std::string & | name, | +
+ | + | const std::string & | value ) | +
Sets a new property on the producer
name | the name of the property |
value | the associated value |
ProducerConfiguration & pulsar::ProducerConfiguration::setSchema | +( | +const SchemaInfo & | schemaInfo | ) | ++ |
Declare the schema of the data that will be published by this producer.
+The schema will be checked against the schema of the topic, and it will fail if it's not compatible, though the client library will not perform any validation that the actual message payload are conforming to the specified schema.
+For all purposes, this
schemaInfo |
ProducerConfiguration & pulsar::ProducerConfiguration::setSendTimeout | +( | +int | sendTimeoutMs | ) | ++ |
The getter associated with getSendTimeout()
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ProducerInterceptor, including all inherited members.
+beforeSend(const Producer &producer, const Message &message)=0 | pulsar::ProducerInterceptor | pure virtual |
close() | pulsar::ProducerInterceptor | inlinevirtual |
onPartitionsChange(const std::string &topicName, int partitions) | pulsar::ProducerInterceptor | inlinevirtual |
onSendAcknowledgement(const Producer &producer, Result result, const Message &message, const MessageId &messageID)=0 | pulsar::ProducerInterceptor | pure virtual |
~ProducerInterceptor() (defined in pulsar::ProducerInterceptor) | pulsar::ProducerInterceptor | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
#include <ProducerInterceptor.h>
+Public Member Functions | |
virtual void | close () |
virtual Message | beforeSend (const Producer &producer, const Message &message)=0 |
virtual void | onSendAcknowledgement (const Producer &producer, Result result, const Message &message, const MessageId &messageID)=0 |
virtual void | onPartitionsChange (const std::string &topicName, int partitions) |
An interface that allows you to intercept (and possibly mutate) the messages received by the producer before they are published to the Pulsar brokers.
+Exceptions thrown by ProducerInterceptor methods will be caught, logged, but not propagated further.
+ProducerInterceptor callbacks may be called from multiple threads. Interceptor implementation must ensure thread-safety, if needed.
+
+
|
+ +pure virtual | +
This is called from Producer::send and Producer::sendAsync methods, before send the message to the brokers. This method is allowed to modify the record, in which case, the new record will be returned.
+Any exception thrown by this method will be caught by the caller and logged, but not propagated further.
+Since the producer may run multiple interceptors, a particular interceptor's #beforeSend(Producer, Message) callback will be called in the order specified by ProducerConfiguration::intercept().
+The first interceptor in the list gets the message passed from the client, the following interceptor will be passed the message returned by the previous interceptor, and so on. Since interceptors are allowed to modify messages, interceptors may potentially get the message already modified by other interceptors. However, building a pipeline of mutable interceptors that depend on the output of the previous interceptor is discouraged, because of potential side-effects caused by interceptors potentially failing to modify the message and throwing an exception. If one of the interceptors in the list throws an exception from beforeSend(Message), the exception is caught, logged, and the next interceptor is called with the message returned by the last successful interceptor in the list, or otherwise the client.
+producer | the producer which contains the interceptor. |
message | message to send. |
+
|
+ +inlinevirtual | +
Close the interceptor
+ +
+
|
+ +inlinevirtual | +
This method is called when partitions of the topic (partitioned-topic) changes.
+topicName | topic name |
partitions | new updated partitions |
+
|
+ +pure virtual | +
This method is called when the message sent to the broker has been acknowledged, or when sending the message fails. This method is generally called just before the user callback is called.
+Any exception thrown by this method will be ignored by the caller.
+This method will generally execute in the background I/O thread, so the implementation should be reasonably fast. Otherwise, sending of messages from other threads could be delayed.
+producer | the producer which contains the interceptor. |
result | the result for sending messages, ResultOk indicates send has succeed. |
message | the message that application sends. |
messageID | the message id that assigned by the broker. |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::Reader, including all inherited members.
+close() | pulsar::Reader | |
closeAsync(ResultCallback callback) | pulsar::Reader | |
getLastMessageId(MessageId &messageId) | pulsar::Reader | |
getLastMessageIdAsync(GetLastMessageIdCallback callback) | pulsar::Reader | |
getTopic() const | pulsar::Reader | |
hasMessageAvailable(bool &hasMessageAvailable) | pulsar::Reader | |
hasMessageAvailableAsync(HasMessageAvailableCallback callback) | pulsar::Reader | |
isConnected() const | pulsar::Reader | |
PulsarFriend (defined in pulsar::Reader) | pulsar::Reader | friend |
PulsarWrapper (defined in pulsar::Reader) | pulsar::Reader | friend |
Reader() | pulsar::Reader | |
ReaderImpl (defined in pulsar::Reader) | pulsar::Reader | friend |
ReaderTest (defined in pulsar::Reader) | pulsar::Reader | friend |
readNext(Message &msg) | pulsar::Reader | |
readNext(Message &msg, int timeoutMs) | pulsar::Reader | |
readNextAsync(ReadNextCallback callback) | pulsar::Reader | |
seek(const MessageId &msgId) | pulsar::Reader | |
seek(uint64_t timestamp) | pulsar::Reader | |
seekAsync(const MessageId &msgId, ResultCallback callback) | pulsar::Reader | |
seekAsync(uint64_t timestamp, ResultCallback callback) | pulsar::Reader | |
TableViewImpl (defined in pulsar::Reader) | pulsar::Reader | friend |
+ pulsar-client-cpp
+
+ |
+
#include <Reader.h>
+Public Member Functions | |
Reader () | |
const std::string & | getTopic () const |
Result | readNext (Message &msg) |
Result | readNext (Message &msg, int timeoutMs) |
void | readNextAsync (ReadNextCallback callback) |
Result | close () |
void | closeAsync (ResultCallback callback) |
void | hasMessageAvailableAsync (HasMessageAvailableCallback callback) |
Result | hasMessageAvailable (bool &hasMessageAvailable) |
Result | seek (const MessageId &msgId) |
Result | seek (uint64_t timestamp) |
void | seekAsync (const MessageId &msgId, ResultCallback callback) |
void | seekAsync (uint64_t timestamp, ResultCallback callback) |
bool | isConnected () const |
void | getLastMessageIdAsync (GetLastMessageIdCallback callback) |
Result | getLastMessageId (MessageId &messageId) |
+Friends | |
+class | PulsarFriend |
+class | PulsarWrapper |
+class | ReaderImpl |
+class | TableViewImpl |
+class | ReaderTest |
A Reader can be used to scan through all the messages currently available in a topic.
+pulsar::Reader::Reader | +( | +) | ++ |
Construct an uninitialized reader object
+ +Result pulsar::Reader::close | +( | +) | ++ |
Close the reader and stop the broker to push more messages
+void pulsar::Reader::closeAsync | +( | +ResultCallback | callback | ) | ++ |
Asynchronously close the reader and stop the broker to push more messages
+callback | the callback that is triggered when the reader is closed |
Get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty.
+ +void pulsar::Reader::getLastMessageIdAsync | +( | +GetLastMessageIdCallback | callback | ) | ++ |
Asynchronously get an ID of the last available message or a message ID with -1 as an entryId if the topic is empty.
+ +const std::string & pulsar::Reader::getTopic | +( | +) | +const | +
Result pulsar::Reader::hasMessageAvailable | +( | +bool & | hasMessageAvailable | ) | ++ |
Check if there is any message available to read from the current position.
+ +void pulsar::Reader::hasMessageAvailableAsync | +( | +HasMessageAvailableCallback | callback | ) | ++ |
Asynchronously check if there is any message available to read from the current position.
+ +bool pulsar::Reader::isConnected | +( | +) | +const | +
Read a single message.
+If a message is not immediately available, this method will block until a new message is available.
+msg | a non-const reference where the received message will be copied |
Read a single message
+msg | a non-const reference where the received message will be copied |
timeoutMs | the receive timeout in milliseconds |
void pulsar::Reader::readNextAsync | +( | +ReadNextCallback | callback | ) | ++ |
Read asynchronously the next message in the topic.
+callback |
Reset the this reader to a specific message id. The message id can either be a specific message or represent the first or last messages in the topic.
+Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.
+messageId | the message id where to reposition the subscription |
Result pulsar::Reader::seek | +( | +uint64_t | timestamp | ) | ++ |
Reset this reader to a specific message publish time.
+timestamp | the message publish time where to reposition the subscription |
void pulsar::Reader::seekAsync | +( | +const MessageId & | msgId, | +
+ | + | ResultCallback | callback ) | +
Asynchronously reset this reader to a specific message id. The message id can either be a specific message or represent the first or last messages in the topic.
+Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.
+messageId | the message id where to reposition the subscription |
void pulsar::Reader::seekAsync | +( | +uint64_t | timestamp, | +
+ | + | ResultCallback | callback ) | +
Asynchronously reset this reader to a specific message publish time.
+timestamp | the message publish time where to reposition the subscription |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::ReaderConfiguration, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
#include <ReaderConfiguration.h>
+Public Member Functions | |
+ | ReaderConfiguration (const ReaderConfiguration &) |
+ReaderConfiguration & | operator= (const ReaderConfiguration &) |
ReaderConfiguration & | setSchema (const SchemaInfo &schemaInfo) |
const SchemaInfo & | getSchema () const |
ReaderConfiguration & | setReaderListener (ReaderListener listener) |
ReaderListener | getReaderListener () const |
bool | hasReaderListener () const |
void | setReceiverQueueSize (int size) |
int | getReceiverQueueSize () const |
void | setReaderName (const std::string &readerName) |
const std::string & | getReaderName () const |
void | setSubscriptionRolePrefix (const std::string &subscriptionRolePrefix) |
const std::string & | getSubscriptionRolePrefix () const |
void | setReadCompacted (bool compacted) |
bool | isReadCompacted () const |
void | setInternalSubscriptionName (std::string internalSubscriptionName) |
const std::string & | getInternalSubscriptionName () const |
void | setUnAckedMessagesTimeoutMs (const uint64_t milliSeconds) |
long | getUnAckedMessagesTimeoutMs () const |
void | setTickDurationInMs (const uint64_t milliSeconds) |
long | getTickDurationInMs () const |
void | setAckGroupingTimeMs (long ackGroupingMillis) |
long | getAckGroupingTimeMs () const |
void | setAckGroupingMaxSize (long maxGroupingSize) |
long | getAckGroupingMaxSize () const |
bool | isEncryptionEnabled () const |
const CryptoKeyReaderPtr | getCryptoKeyReader () const |
ReaderConfiguration & | setCryptoKeyReader (CryptoKeyReaderPtr cryptoKeyReader) |
ConsumerCryptoFailureAction | getCryptoFailureAction () const |
ReaderConfiguration & | setCryptoFailureAction (ConsumerCryptoFailureAction action) |
ReaderConfiguration & | setStartMessageIdInclusive (bool startMessageIdInclusive) |
bool | isStartMessageIdInclusive () const |
bool | hasProperty (const std::string &name) const |
const std::string & | getProperty (const std::string &name) const |
std::map< std::string, std::string > & | getProperties () const |
ReaderConfiguration & | setProperty (const std::string &name, const std::string &value) |
ReaderConfiguration & | setProperties (const std::map< std::string, std::string > &properties) |
Class specifying the configuration of a consumer.
+long pulsar::ReaderConfiguration::getAckGroupingMaxSize | +( | +) | +const | +
Get max number of grouped messages within one grouping time window.
+long pulsar::ReaderConfiguration::getAckGroupingTimeMs | +( | +) | +const | +
Get grouping time window in milliseconds.
+ConsumerCryptoFailureAction pulsar::ReaderConfiguration::getCryptoFailureAction | +( | +) | +const | +
const CryptoKeyReaderPtr pulsar::ReaderConfiguration::getCryptoKeyReader | +( | +) | +const | +
const std::string & pulsar::ReaderConfiguration::getInternalSubscriptionName | +( | +) | +const | +
std::map< std::string, std::string > & pulsar::ReaderConfiguration::getProperties | +( | +) | +const | +
Get all the properties attached to this producer.
+ +const std::string & pulsar::ReaderConfiguration::getProperty | +( | +const std::string & | name | ) | +const | +
Get the value of a specific property
+name | the name of the property |
ReaderListener pulsar::ReaderConfiguration::getReaderListener | +( | +) | +const | +
ReaderListener
for the reader const std::string & pulsar::ReaderConfiguration::getReaderName | +( | +) | +const | +
int pulsar::ReaderConfiguration::getReceiverQueueSize | +( | +) | +const | +
const SchemaInfo & pulsar::ReaderConfiguration::getSchema | +( | +) | +const | +
const std::string & pulsar::ReaderConfiguration::getSubscriptionRolePrefix | +( | +) | +const | +
long pulsar::ReaderConfiguration::getTickDurationInMs | +( | +) | +const | +
long pulsar::ReaderConfiguration::getUnAckedMessagesTimeoutMs | +( | +) | +const | +
bool pulsar::ReaderConfiguration::hasProperty | +( | +const std::string & | name | ) | +const | +
Check whether the message has a specific property attached.
+name | the name of the property to check |
bool pulsar::ReaderConfiguration::hasReaderListener | +( | +) | +const | +
ReaderListener
has been set bool pulsar::ReaderConfiguration::isEncryptionEnabled | +( | +) | +const | +
bool pulsar::ReaderConfiguration::isReadCompacted | +( | +) | +const | +
bool pulsar::ReaderConfiguration::isStartMessageIdInclusive | +( | +) | +const | +
The associated getter of setStartMessageIdInclusive
+ +void pulsar::ReaderConfiguration::setAckGroupingMaxSize | +( | +long | maxGroupingSize | ) | ++ |
Set max number of grouped messages within one grouping time window. If it's set to a non-positive value, number of grouped messages is not limited. Default is 1000.
+maxGroupingSize | max number of grouped messages with in one grouping time window. |
void pulsar::ReaderConfiguration::setAckGroupingTimeMs | +( | +long | ackGroupingMillis | ) | ++ |
Set time window in milliseconds for grouping message ACK requests. An ACK request is not sent to broker until the time window reaches its end, or the number of grouped messages reaches limit. Default is 100 milliseconds. If it's set to a non-positive value, ACK requests will be directly sent to broker without grouping.
+ackGroupMillis | time of ACK grouping window in milliseconds. |
ReaderConfiguration & pulsar::ReaderConfiguration::setCryptoFailureAction | +( | +ConsumerCryptoFailureAction | action | ) | ++ |
Set the CryptoFailureAction for the reader.
+ +ReaderConfiguration & pulsar::ReaderConfiguration::setCryptoKeyReader | +( | +CryptoKeyReaderPtr | cryptoKeyReader | ) | ++ |
Set the shared pointer to CryptoKeyReader.
+the | shared pointer to CryptoKeyReader |
void pulsar::ReaderConfiguration::setInternalSubscriptionName | +( | +std::string | internalSubscriptionName | ) | ++ |
Set the internal subscription name.
+internal | subscriptionName Default value is reader-{random string}. |
ReaderConfiguration & pulsar::ReaderConfiguration::setProperties | +( | +const std::map< std::string, std::string > & | properties | ) | ++ |
Add all the properties in the provided map
+ +ReaderConfiguration & pulsar::ReaderConfiguration::setProperty | +( | +const std::string & | name, | +
+ | + | const std::string & | value ) | +
Sets a new property on a message.
name | the name of the property |
value | the associated value |
void pulsar::ReaderConfiguration::setReadCompacted | +( | +bool | compacted | ) | ++ |
If enabled, the consumer reads messages from the compacted topics rather than reading the full message backlog of the topic. This means that if the topic has been compacted, the consumer only sees the latest value for each key in the topic, up until the point in the topic message backlog that has been compacted. Beyond that point, message is sent as normal.
+readCompacted can only be enabled subscriptions to persistent topics, which have a single active consumer (for example, failure or exclusive subscriptions). Attempting to enable it on subscriptions to a non-persistent topics or on a shared subscription leads to the subscription call failure.
+readCompacted | whether to read from the compacted topic |
ReaderConfiguration & pulsar::ReaderConfiguration::setReaderListener | +( | +ReaderListener | listener | ) | ++ |
A message listener enables your application to configure how to process messages. A listener will be called in order for every message received.
+ +void pulsar::ReaderConfiguration::setReaderName | +( | +const std::string & | readerName | ) | ++ |
Set the reader name.
+readerName |
void pulsar::ReaderConfiguration::setReceiverQueueSize | +( | +int | size | ) | ++ |
Sets the size of the reader receive queue.
+The consumer receive queue controls how many messages can be accumulated by the consumer before the application calls receive(). Using a higher value may potentially increase the consumer throughput at the expense of bigger memory utilization.
+Setting the consumer queue size to 0 decreases the throughput of the consumer by disabling pre-fetching of messages. This approach improves the message distribution on shared subscription by pushing messages only to the consumers that are ready to process them. Neither receive with timeout nor partitioned topics can be used if the consumer queue size is 0. The receive() function call should not be interrupted when the consumer queue size is 0.
+The default value is 1000 messages and it is appropriate for most use cases.
+size | the new receiver queue size value |
ReaderConfiguration & pulsar::ReaderConfiguration::setSchema | +( | +const SchemaInfo & | schemaInfo | ) | ++ |
Declare the schema of the data that this reader will be accepting.
+The schema will be checked against the schema of the topic, and the reader creation will fail if it's not compatible.
+schemaInfo | the schema definition object |
ReaderConfiguration & pulsar::ReaderConfiguration::setStartMessageIdInclusive | +( | +bool | startMessageIdInclusive | ) | ++ |
Set the reader to include the startMessageId or given position of any reset operation like Reader::seek.
+Default: false
+startMessageIdInclusive | whether to include the reset position |
void pulsar::ReaderConfiguration::setSubscriptionRolePrefix | +( | +const std::string & | subscriptionRolePrefix | ) | ++ |
Set the subscription role prefix.
+The default prefix is an empty string.
+subscriptionRolePrefix |
void pulsar::ReaderConfiguration::setTickDurationInMs | +( | +const uint64_t | milliSeconds | ) | ++ |
Set the tick duration time that defines the granularity of the ack-timeout redelivery (in milliseconds).
+The default value is 1000, which means 1 second.
+Using a higher tick time reduces the memory overhead to track messages when the ack-timeout is set to a bigger value.
+milliSeconds | the tick duration time (in milliseconds) |
void pulsar::ReaderConfiguration::setUnAckedMessagesTimeoutMs | +( | +const uint64_t | milliSeconds | ) | ++ |
Set the timeout in milliseconds for unacknowledged messages, the timeout needs to be greater than 10 seconds. An Exception is thrown if the given value is less than 10000 (10 seconds). If a successful acknowledgement is not sent within the timeout all the unacknowledged messages are redelivered.
timeout | in milliseconds |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::SchemaInfo, including all inherited members.
+getName() const | pulsar::SchemaInfo | |
getProperties() const | pulsar::SchemaInfo | |
getSchema() const | pulsar::SchemaInfo | |
getSchemaType() const | pulsar::SchemaInfo | |
SchemaInfo() | pulsar::SchemaInfo | |
SchemaInfo(SchemaType schemaType, const std::string &name, const std::string &schema, const StringMap &properties=StringMap()) | pulsar::SchemaInfo | |
SchemaInfo(const SchemaInfo &keySchema, const SchemaInfo &valueSchema, const KeyValueEncodingType &keyValueEncodingType=KeyValueEncodingType::INLINE) | pulsar::SchemaInfo |
+ pulsar-client-cpp
+
+ |
+
#include <Schema.h>
+Public Member Functions | |
SchemaInfo () | |
SchemaInfo (SchemaType schemaType, const std::string &name, const std::string &schema, const StringMap &properties=StringMap()) | |
SchemaInfo (const SchemaInfo &keySchema, const SchemaInfo &valueSchema, const KeyValueEncodingType &keyValueEncodingType=KeyValueEncodingType::INLINE) | |
SchemaType | getSchemaType () const |
const std::string & | getName () const |
const std::string & | getSchema () const |
const StringMap & | getProperties () const |
Encapsulates data around the schema definition
+pulsar::SchemaInfo::SchemaInfo | +( | +) | ++ |
The default constructor with following configs:
pulsar::SchemaInfo::SchemaInfo | +( | +SchemaType | schemaType, | +
+ | + | const std::string & | name, | +
+ | + | const std::string & | schema, | +
+ | + | const StringMap & | properties = StringMap() ) | +
schemaType | the schema type |
name | the name of the schema definition |
schema | the schema definition as a JSON string |
properties | a map of custom defined properties attached to the schema |
pulsar::SchemaInfo::SchemaInfo | +( | +const SchemaInfo & | keySchema, | +
+ | + | const SchemaInfo & | valueSchema, | +
+ | + | const KeyValueEncodingType & | keyValueEncodingType = KeyValueEncodingType::INLINE ) | +
keySchema | the key schema. |
valueSchema | the value schema. |
keyValueEncodingType | Encoding types of supported KeyValueSchema for Pulsar messages. |
const std::string & pulsar::SchemaInfo::getName | +( | +) | +const | +
const StringMap & pulsar::SchemaInfo::getProperties | +( | +) | +const | +
const std::string & pulsar::SchemaInfo::getSchema | +( | +) | +const | +
SchemaType pulsar::SchemaInfo::getSchemaType | +( | +) | +const | +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::TableView, including all inherited members.
+ClientImpl (defined in pulsar::TableView) | pulsar::TableView | friend |
close() | pulsar::TableView | |
closeAsync(ResultCallback callback) | pulsar::TableView | |
containsKey(const std::string &key) const | pulsar::TableView | |
forEach(TableViewAction action) | pulsar::TableView | |
forEachAndListen(TableViewAction action) | pulsar::TableView | |
getValue(const std::string &key, std::string &value) const | pulsar::TableView | |
PulsarFriend (defined in pulsar::TableView) | pulsar::TableView | friend |
retrieveValue(const std::string &key, std::string &value) | pulsar::TableView | |
size() const | pulsar::TableView | |
snapshot() | pulsar::TableView | |
TableView() | pulsar::TableView |
+ pulsar-client-cpp
+
+ |
+
+Public Member Functions | |
TableView () | |
bool | retrieveValue (const std::string &key, std::string &value) |
bool | getValue (const std::string &key, std::string &value) const |
bool | containsKey (const std::string &key) const |
std::unordered_map< std::string, std::string > | snapshot () |
std::size_t | size () const |
void | forEach (TableViewAction action) |
void | forEachAndListen (TableViewAction action) |
void | closeAsync (ResultCallback callback) |
Result | close () |
+Friends | |
+class | PulsarFriend |
+class | ClientImpl |
pulsar::TableView::TableView | +( | +) | ++ |
Construct an uninitialized tableView object
+ +Result pulsar::TableView::close | +( | +) | ++ |
Close the table view and stop the broker to push more messages
+ +void pulsar::TableView::closeAsync | +( | +ResultCallback | callback | ) | ++ |
Asynchronously close the tableview and stop the broker to push more messages
+ +bool pulsar::TableView::containsKey | +( | +const std::string & | key | ) | +const | +
Check if the key exists in the table view.
+void pulsar::TableView::forEach | +( | +TableViewAction | action | ) | ++ |
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.
+ +void pulsar::TableView::forEachAndListen | +( | +TableViewAction | action | ) | ++ |
Performs the given action for each entry in this map until all entries have been processed and register the callback, which will be called each time a key-value pair is updated.
+ +bool pulsar::TableView::getValue | +( | +const std::string & | key, | +
+ | + | std::string & | value ) const | +
It's similar with retrievedValue except the value is copied into value
.
key | |
value | the value associated with the key |
bool pulsar::TableView::retrieveValue | +( | +const std::string & | key, | +
+ | + | std::string & | value ) | +
Move the latest value associated with the key.
+Example:
+key | |
value | the value associated with the key |
NOTE: Once the value has been retrieved successfully, the associated value will be removed from the table view until next time the value is updated.
+ +std::size_t pulsar::TableView::size | +( | +) | +const | +
Get the size of the elements.
+ +std::unordered_map< std::string, std::string > pulsar::TableView::snapshot | +( | +) | ++ |
Move the table view data into the unordered map.
+ +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::TopicMetadata, including all inherited members.
+getNumPartitions() const =0 | pulsar::TopicMetadata | pure virtual |
~TopicMetadata() (defined in pulsar::TopicMetadata) | pulsar::TopicMetadata | inlinevirtual |
+ pulsar-client-cpp
+
+ |
+
#include <TopicMetadata.h>
+Public Member Functions | |
virtual int | getNumPartitions () const =0 |
Metadata of a topic that can be used for message routing.
+
+
|
+ +pure virtual | +
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::TypedMessage< T >, including all inherited members.
+Decoder typedef (defined in pulsar::TypedMessage< T >) | pulsar::TypedMessage< T > | |
getData() const | pulsar::Message | |
getDataAsString() const | pulsar::Message | |
getEventTimestamp() const | pulsar::Message | |
getIndex() const | pulsar::Message | |
getKeyValueData() const | pulsar::Message | |
getLength() const | pulsar::Message | |
getLongSchemaVersion() const | pulsar::Message | |
getMessageId() const | pulsar::Message | |
getOrderingKey() const | pulsar::Message | |
getPartitionKey() const | pulsar::Message | |
getProperties() const | pulsar::Message | |
getProperty(const std::string &name) const | pulsar::Message | |
getPublishTimestamp() const | pulsar::Message | |
getRedeliveryCount() const | pulsar::Message | |
getSchemaVersion() const | pulsar::Message | |
getTopicName() const | pulsar::Message | |
getValue() const (defined in pulsar::TypedMessage< T >) | pulsar::TypedMessage< T > | inline |
hasOrderingKey() const | pulsar::Message | |
hasPartitionKey() const | pulsar::Message | |
hasProperty(const std::string &name) const | pulsar::Message | |
hasSchemaVersion() const | pulsar::Message | |
impl_ (defined in pulsar::Message) | pulsar::Message | protected |
Message() (defined in pulsar::Message) | pulsar::Message | |
Message(MessageImplPtr &impl) (defined in pulsar::Message) | pulsar::Message | protected |
Message(const MessageId &messageId, proto::BrokerEntryMetadata &brokerEntryMetadata, proto::MessageMetadata &metadata, SharedBuffer &payload) (defined in pulsar::Message) | pulsar::Message | protected |
Message(const MessageId &messageId, proto::BrokerEntryMetadata &brokerEntryMetadata, proto::MessageMetadata &metadata, SharedBuffer &payload, proto::SingleMessageMetadata &singleMetadata, const std::shared_ptr< std::string > &topicName) | pulsar::Message | protected |
MessageImplPtr typedef (defined in pulsar::Message) | pulsar::Message | protected |
operator==(const Message &msg) const (defined in pulsar::Message) | pulsar::Message | |
setDecoder(Decoder decoder) (defined in pulsar::TypedMessage< T >) | pulsar::TypedMessage< T > | inline |
setMessageId(const MessageId &messageId) const | pulsar::Message | |
StringMap typedef (defined in pulsar::Message) | pulsar::Message | |
TypedMessage()=default (defined in pulsar::TypedMessage< T >) | pulsar::TypedMessage< T > | |
TypedMessage(const Message &message, Decoder decoder=[](const char *, std::size_t) { return T{};}) (defined in pulsar::TypedMessage< T >) | pulsar::TypedMessage< T > | inline |
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
+using | Decoder = std::function<T(const char*, std::size_t)> |
+Public Member Functions | |
+ | TypedMessage (const Message &message, Decoder decoder=[](const char *, std::size_t) { return T{};}) |
+T | getValue () const |
+TypedMessage & | setDecoder (Decoder decoder) |
+Additional Inherited Members |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::TypedMessageBuilder< T >, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
+using | Encoder = std::function<std::string(const T&)> |
+using | Validator = std::function<void(const char* data, size_t)> |
+Public Member Functions | |
+ | TypedMessageBuilder (Encoder encoder, Validator validator=[](const char *, std::size_t) {}) |
+TypedMessageBuilder & | setValue (const T &value) |
+Additional Inherited Members |
+ pulsar-client-cpp
+
+ |
+
This is the complete list of members for pulsar::TypedMessageBuilder< std::string >, including all inherited members.
+
+ pulsar-client-cpp
+
+ |
+
+Public Types | |
+using | Validator = std::function<void(const char* data, size_t)> |
+Public Member Functions | |
+ | TypedMessageBuilder (Validator validator=nullptr) |
+TypedMessageBuilder & | setValue (const std::string &value) |
+TypedMessageBuilder & | setValue (std::string &&value) |
+Additional Inherited Members |
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
msg
though msg
is const
.
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+Directories | |
c | |
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
▼ include | |
▼ pulsar | |
▼ c | |
authentication.h | |
client.h | |
client_configuration.h | |
consumer.h | |
consumer_configuration.h | |
message.h | |
message_id.h | |
message_router.h | |
messages.h | |
producer.h | |
producer_configuration.h | |
reader.h | |
reader_configuration.h | |
result.h | |
string_list.h | |
string_map.h | |
table_view.h | |
table_view_configuration.h | |
version.h | |
Authentication.h | |
BatchReceivePolicy.h | |
BrokerConsumerStats.h | |
Client.h | |
ClientConfiguration.h | |
CompressionType.h | |
ConsoleLoggerFactory.h | |
Consumer.h | |
ConsumerConfiguration.h | |
ConsumerCryptoFailureAction.h | |
ConsumerEventListener.h | |
ConsumerInterceptor.h | |
ConsumerType.h | |
CryptoKeyReader.h | |
DeadLetterPolicy.h | |
DeadLetterPolicyBuilder.h | |
defines.h | |
DeprecatedException.h | |
EncryptionKeyInfo.h | |
FileLoggerFactory.h | |
InitialPosition.h | |
KeySharedPolicy.h | |
KeyValue.h | |
Logger.h | |
Message.h | |
MessageBatch.h | |
MessageBuilder.h | |
MessageId.h | |
MessageIdBuilder.h | |
MessageRoutingPolicy.h | |
Producer.h | |
ProducerConfiguration.h | |
ProducerCryptoFailureAction.h | |
ProducerInterceptor.h | |
ProtobufNativeSchema.h | |
Reader.h | |
ReaderConfiguration.h | |
RegexSubscriptionMode.h | |
Result.h | |
Schema.h | |
TableView.h | |
TableViewConfiguration.h | |
TopicMetadata.h | |
TypedMessage.h | |
TypedMessageBuilder.h |
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
+ pulsar-client-cpp
+
+ |
+
Pulsar C++ clients support a variety of Pulsar features to enable building applications connecting to your Pulsar cluster.
+For the supported Pulsar features, see Client Feature Matrix.
+For how to use APIs to publish and consume messages, see examples.
+Navigate to vcpkg-example for how to import the pulsar-client-cpp
into your project via vcpkg.
For non-vcpkg projects, you can download pre-built binaries from the official release page.
+Pulsar C++ client uses doxygen to build API documents. After installing doxygen
, you only need to run doxygen
to generate the API documents whose main page is under the doxygen/html/index.html
path.
Since it's integrated with vcpkg, see vcpkg#README for the requirements. See LEGACY_BUILD if you want to manage dependencies by yourself or you cannot install vcpkg in your own environment.
+The simplest way is to clone this project with the vcpkg submodule.
+The 1st step will download vcpkg and then install all dependencies according to the version description in vcpkg.json. The 2nd step will build the Pulsar C++ libraries under ./build/lib/
, where ./build
is the CMake build directory.
++You can also add the CMAKE_TOOLCHAIN_FILE option if your system already have vcpkg installed.
+git clone https://github.com/apache/pulsar-client-cpp.git+cd pulsar-client-cpp+# For example, you can install vcpkg in /tmp/vcpkg+cd /tmp && git clone https://github.com/microsoft/vcpkg.git && cd -+cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE="/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake"+cmake --build build -j8+
After the build, the hierarchy of the build
directory will be:
To install the C++ headers and libraries into a specific path, e.g. /tmp/pulsar
, run the following commands:
For example, on macOS you will see:
+Tests are built by default. You should execute run-unit-tests.sh to run tests locally.
+If you don't want to build the tests, disable the BUILD_TESTS
option:
If you want to build the perf tools, enable the BUILD_PERF_TOOLS
option:
Then the perf tools will be built under ./build/perf/
.
Pulsar C++ Client Library has been tested on:
+See the wireshark directory for details.
+It's required to install LLVM for clang-tidy
and clang-format
. Pulsar C++ client use clang-format
11 to format files. make format
automatically formats the files.
For Ubuntu users, you can install clang-format-11
via apt install clang-format-11
. For other users, run ./build-support/docker-format.sh
if you have Docker installed.
We welcome contributions from the open source community, kindly make sure your changes are backward compatible with GCC 4.8 and Boost 1.53.
+If your contribution adds Pulsar features for C++ clients, you need to update both the Pulsar docs and the Client Feature Matrix. See Contribution Guide for more details.
+