pulsar-client-cpp
Loading...
Searching...
No Matches
ReaderConfiguration.h
1
19#ifndef PULSAR_READER_CONFIGURATION_H_
20#define PULSAR_READER_CONFIGURATION_H_
21
22#include <pulsar/ConsumerCryptoFailureAction.h>
23#include <pulsar/CryptoKeyReader.h>
24#include <pulsar/Message.h>
25#include <pulsar/Result.h>
26#include <pulsar/Schema.h>
27#include <pulsar/defines.h>
28
29#include <functional>
30#include <memory>
31
32namespace pulsar {
33
34class Reader;
35class PulsarWrapper;
36
38typedef std::function<void(Result result)> ResultCallback;
39typedef std::function<void(Result result, MessageId messageId)> GetLastMessageIdCallback;
40
42typedef std::function<void(Reader reader, const Message& msg)> ReaderListener;
43
44struct ReaderConfigurationImpl;
45
49class PULSAR_PUBLIC ReaderConfiguration {
50 public:
55
65
69 const SchemaInfo& getSchema() const;
70
76
81
85 bool hasReaderListener() const;
86
108 void setReceiverQueueSize(int size);
109
114
120 void setReaderName(const std::string& readerName);
121
125 const std::string& getReaderName() const;
126
134 void setSubscriptionRolePrefix(const std::string& subscriptionRolePrefix);
135
139 const std::string& getSubscriptionRolePrefix() const;
140
154 void setReadCompacted(bool compacted);
155
159 bool isReadCompacted() const;
160
167 void setInternalSubscriptionName(std::string internalSubscriptionName);
168
172 const std::string& getInternalSubscriptionName() const;
173
181 void setUnAckedMessagesTimeoutMs(const uint64_t milliSeconds);
182
187
200 void setTickDurationInMs(const uint64_t milliSeconds);
201
206
215 void setAckGroupingTimeMs(long ackGroupingMillis);
216
223
230 void setAckGroupingMaxSize(long maxGroupingSize);
231
238
243
247 const CryptoKeyReaderPtr getCryptoKeyReader() const;
248
254 ReaderConfiguration& setCryptoKeyReader(CryptoKeyReaderPtr cryptoKeyReader);
255
259 ConsumerCryptoFailureAction getCryptoFailureAction() const;
260
264 ReaderConfiguration& setCryptoFailureAction(ConsumerCryptoFailureAction action);
265
274 ReaderConfiguration& setStartMessageIdInclusive(bool startMessageIdInclusive);
275
280
288 bool hasProperty(const std::string& name) const;
289
296 const std::string& getProperty(const std::string& name) const;
297
301 std::map<std::string, std::string>& getProperties() const;
302
308 ReaderConfiguration& setProperty(const std::string& name, const std::string& value);
309
313 ReaderConfiguration& setProperties(const std::map<std::string, std::string>& properties);
314
315 private:
316 std::shared_ptr<ReaderConfigurationImpl> impl_;
317};
318} // namespace pulsar
319#endif /* PULSAR_READER_CONFIGURATION_H_ */
Definition Message.h:44
Definition ReaderConfiguration.h:49
void setReceiverQueueSize(int size)
bool hasProperty(const std::string &name) const
void setUnAckedMessagesTimeoutMs(const uint64_t milliSeconds)
ReaderConfiguration & setProperties(const std::map< std::string, std::string > &properties)
long getTickDurationInMs() const
void setTickDurationInMs(const uint64_t milliSeconds)
void setSubscriptionRolePrefix(const std::string &subscriptionRolePrefix)
bool isStartMessageIdInclusive() const
long getUnAckedMessagesTimeoutMs() const
ReaderConfiguration & setCryptoKeyReader(CryptoKeyReaderPtr cryptoKeyReader)
const SchemaInfo & getSchema() const
ReaderConfiguration & setCryptoFailureAction(ConsumerCryptoFailureAction action)
void setReaderName(const std::string &readerName)
ReaderConfiguration & setProperty(const std::string &name, const std::string &value)
const std::string & getInternalSubscriptionName() const
std::map< std::string, std::string > & getProperties() const
bool isEncryptionEnabled() const
ReaderListener getReaderListener() const
void setReadCompacted(bool compacted)
const std::string & getProperty(const std::string &name) const
void setAckGroupingTimeMs(long ackGroupingMillis)
ReaderConfiguration & setReaderListener(ReaderListener listener)
ReaderConfiguration & setSchema(const SchemaInfo &schemaInfo)
ReaderConfiguration & setStartMessageIdInclusive(bool startMessageIdInclusive)
long getAckGroupingTimeMs() const
const std::string & getReaderName() const
const CryptoKeyReaderPtr getCryptoKeyReader() const
void setInternalSubscriptionName(std::string internalSubscriptionName)
const std::string & getSubscriptionRolePrefix() const
ConsumerCryptoFailureAction getCryptoFailureAction() const
void setAckGroupingMaxSize(long maxGroupingSize)
long getAckGroupingMaxSize() const
Definition Reader.h:37
Definition Schema.h:146
Definition Authentication.h:31
std::function< void(Reader reader, const Message &msg)> ReaderListener
Callback definition for MessageListener.
Definition ReaderConfiguration.h:42
std::function< void(Result result)> ResultCallback
Callback definition for non-data operation.
Definition ConsumerConfiguration.h:50
Result
Definition Result.h:32