19 #ifndef PULSAR_PRODUCERCONFIGURATION_H_
20 #define PULSAR_PRODUCERCONFIGURATION_H_
21 #include <pulsar/CompressionType.h>
22 #include <pulsar/CryptoKeyReader.h>
23 #include <pulsar/Message.h>
24 #include <pulsar/MessageRoutingPolicy.h>
25 #include <pulsar/ProducerCryptoFailureAction.h>
26 #include <pulsar/ProducerInterceptor.h>
27 #include <pulsar/Result.h>
28 #include <pulsar/Schema.h>
29 #include <pulsar/defines.h>
36 typedef std::function<void(
Result,
const MessageId& messageId)> SendCallback;
37 typedef std::function<void(
Result)> CloseCallback;
39 struct ProducerConfigurationImpl;
47 enum PartitionsRoutingMode
50 RoundRobinDistribution,
104 ExclusiveWithFencing = 3
123 const std::string& getProducerName()
const;
159 int getSendTimeout()
const;
177 int64_t getInitialSequenceId()
const;
199 CompressionType getCompressionType()
const;
217 int getMaxPendingMessages()
const;
229 ProducerConfiguration& setMaxPendingMessagesAcrossPartitions(
int maxPendingMessagesAcrossPartitions);
234 int getMaxPendingMessagesAcrossPartitions()
const;
249 PartitionsRoutingMode getPartitionsRoutingMode()
const;
262 const MessageRoutingPolicyPtr& getMessageRouterPtr()
const;
287 HashingScheme getHashingScheme()
const;
308 bool getLazyStartPartitionedProducers()
const;
319 bool getBlockIfQueueFull()
const;
347 const bool& getBatchingEnabled()
const;
365 const unsigned int& getBatchingMaxMessages()
const;
380 const unsigned long& batchingMaxAllowedSizeInBytes);
385 const unsigned long& getBatchingMaxAllowedSizeInBytes()
const;
399 const unsigned long& getBatchingMaxPublishDelayMs()
const;
412 BatchingType getBatchingType()
const;
417 const CryptoKeyReaderPtr getCryptoKeyReader()
const;
430 ProducerCryptoFailureAction getCryptoFailureAction()
const;
444 const std::set<std::string>& getEncryptionKeys()
const;
449 bool isEncryptionEnabled()
const;
472 bool hasProperty(
const std::string& name)
const;
480 const std::string& getProperty(
const std::string& name)
const;
485 std::map<std::string, std::string>& getProperties()
const;
526 bool isChunkingEnabled()
const;
540 ProducerAccessMode getAccessMode()
const;
544 const std::vector<ProducerInterceptorPtr>& getInterceptors()
const;
547 std::shared_ptr<ProducerConfigurationImpl> impl_;
549 friend class PulsarWrapper;
550 friend class ConsumerImpl;
551 friend class ProducerImpl;