19#ifndef PULSAR_CONSUMERCONFIGURATION_H_
20#define PULSAR_CONSUMERCONFIGURATION_H_
24#include <pulsar/defines.h>
25#include <pulsar/Result.h>
26#include <pulsar/ConsumerType.h>
27#include <pulsar/Message.h>
28#include <pulsar/Schema.h>
29#include <pulsar/ConsumerCryptoFailureAction.h>
30#include <pulsar/CryptoKeyReader.h>
31#include <pulsar/InitialPosition.h>
32#include <pulsar/KeySharedPolicy.h>
33#include <pulsar/ConsumerEventListener.h>
34#include "BatchReceivePolicy.h"
44typedef std::function<void(
Result,
const Message& msg)> ReceiveCallback;
45typedef std::function<void(
Result,
const Messages& msgs)> BatchReceiveCallback;
46typedef std::function<void(
Result result,
MessageId messageId)> GetLastMessageIdCallback;
51typedef std::shared_ptr<ConsumerEventListener> ConsumerEventListenerPtr;
53struct ConsumerConfigurationImpl;
459 const std::map<std::string, std::string>& subscriptionProperties);
513 bool autoAckOldestChunkedMessageOnQueueFull);
534 friend class PulsarWrapper;
537 std::shared_ptr<ConsumerConfigurationImpl> impl_;
Definition: BatchReceivePolicy.h:51
Definition: ConsumerConfiguration.h:58
ConsumerConfiguration & setProperties(const std::map< std::string, std::string > &properties)
ConsumerConfiguration & setPriorityLevel(int priorityLevel)
ConsumerType getConsumerType() const
long getBrokerConsumerStatsCacheTimeInMs() const
void setReceiverQueueSize(int size)
long getTickDurationInMs() const
MessageListener getMessageListener() const
ConsumerCryptoFailureAction getCryptoFailureAction() const
long getUnAckedMessagesTimeoutMs() const
ConsumerConfiguration & setAutoAckOldestChunkedMessageOnQueueFull(bool autoAckOldestChunkedMessageOnQueueFull)
void setBrokerConsumerStatsCacheTimeInMs(const long cacheTimeInMs)
size_t getMaxPendingChunkedMessage() const
int getPriorityLevel() const
bool isReplicateSubscriptionStateEnabled() const
bool isAutoAckOldestChunkedMessageOnQueueFull() const
ConsumerConfiguration & setConsumerType(ConsumerType consumerType)
int getPatternAutoDiscoveryPeriod() const
ConsumerConfiguration & setKeySharedPolicy(KeySharedPolicy keySharedPolicy)
void setBatchReceivePolicy(const BatchReceivePolicy &batchReceivePolicy)
void setPatternAutoDiscoveryPeriod(int periodInSeconds)
void setAckGroupingMaxSize(long maxGroupingSize)
std::map< std::string, std::string > & getProperties() const
int getReceiverQueueSize() const
InitialPosition getSubscriptionInitialPosition() const
long getAckGroupingMaxSize() const
ConsumerConfiguration & setConsumerEventListener(ConsumerEventListenerPtr eventListener)
const CryptoKeyReaderPtr getCryptoKeyReader() const
void setReplicateSubscriptionStateEnabled(bool enabled)
bool isReadCompacted() const
ConsumerConfiguration & setSchema(const SchemaInfo &schemaInfo)
long getNegativeAckRedeliveryDelayMs() const
bool hasProperty(const std::string &name) const
const std::string & getProperty(const std::string &name) const
void setTickDurationInMs(const uint64_t milliSeconds)
const BatchReceivePolicy & getBatchReceivePolicy() const
bool isStartMessageIdInclusive() const
ConsumerConfiguration & setMessageListener(MessageListener messageListener)
void setConsumerName(const std::string &consumerName)
void setMaxTotalReceiverQueueSizeAcrossPartitions(int maxTotalReceiverQueueSizeAcrossPartitions)
ConsumerConfiguration & setMaxPendingChunkedMessage(size_t maxPendingChunkedMessage)
ConsumerConfiguration & setCryptoKeyReader(CryptoKeyReaderPtr cryptoKeyReader)
std::map< std::string, std::string > & getSubscriptionProperties() const
ConsumerConfiguration & setCryptoFailureAction(ConsumerCryptoFailureAction action)
void setSubscriptionInitialPosition(InitialPosition subscriptionInitialPosition)
bool hasConsumerEventListener() const
long getAckGroupingTimeMs() const
int getMaxTotalReceiverQueueSizeAcrossPartitions() const
bool isEncryptionEnabled() const
ConsumerConfiguration & setProperty(const std::string &name, const std::string &value)
const SchemaInfo & getSchema() const
void setUnAckedMessagesTimeoutMs(const uint64_t milliSeconds)
ConsumerEventListenerPtr getConsumerEventListener() const
KeySharedPolicy getKeySharedPolicy() const
void setReadCompacted(bool compacted)
ConsumerConfiguration clone() const
ConsumerConfiguration & setSubscriptionProperties(const std::map< std::string, std::string > &subscriptionProperties)
void setNegativeAckRedeliveryDelayMs(long redeliveryDelayMillis)
const std::string & getConsumerName() const
void setAckGroupingTimeMs(long ackGroupingMillis)
ConsumerConfiguration & setStartMessageIdInclusive(bool startMessageIdInclusive)
bool hasMessageListener() const
Definition: Consumer.h:35
Definition: KeySharedPolicy.h:53
Definition: MessageId.h:32
Definition: Authentication.h:30
std::function< void(Consumer consumer, const Message &msg)> MessageListener
Callback definition for MessageListener.
Definition: ConsumerConfiguration.h:49
ConsumerType
Definition: ConsumerType.h:24
std::vector< Message > Messages
Callback definition for non-data operation.
Definition: ConsumerConfiguration.h:42
std::function< void(Result result)> ResultCallback
Callback definition for non-data operation.
Definition: ConsumerConfiguration.h:43
Result
Definition: Result.h:31