Modern C++ Kafka API
ProducerConfig.h
1 #pragma once
2 
3 #include <kafka/Project.h>
4 
5 #include <kafka/ClientConfig.h>
6 
7 
8 namespace KAFKA_API { namespace clients { namespace producer {
9 
13 class ProducerConfig: public Config
14 {
15 public:
16  ProducerConfig() = default;
17  ProducerConfig(const ProducerConfig&) = default;
18  explicit ProducerConfig(const PropertiesMap& kvMap): Config(kvMap) {}
19 
20 
31  static const constexpr char* ACKS = "acks";
32 
37  static const constexpr char* QUEUE_BUFFERING_MAX_MESSAGES = "queue.buffering.max.messages";
38 
43  static const constexpr char* QUEUE_BUFFERING_MAX_KBYTES = "queue.buffering.max.kbytes";
44 
49  static const constexpr char* LINGER_MS = "linger.ms";
50 
55  static const constexpr char* BATCH_NUM_MESSAGES = "batch.num.messages";
56 
61  static const constexpr char* BATCH_SIZE = "batch.size";
62 
68  static const constexpr char* MESSAGE_MAX_BYTES = "message.max.bytes";
69 
75  static const constexpr char* MESSAGE_TIMEOUT_MS = "message.timeout.ms";
76 
82  static const constexpr char* REQUEST_TIMEOUT_MS = "request.timeout.ms";
83 
97  static const constexpr char* PARTITIONER = "partitioner";
98 
103  static const constexpr char* MAX_IN_FLIGHT = "max.in.flight";
104 
109  static const constexpr char* ENABLE_IDEMPOTENCE = "enable.idempotence";
110 
114  static const constexpr char* TRANSACTIONAL_ID = "transactional.id";
115 
120  static const constexpr char* TRANSACTION_TIMEOUT_MS = "transaction.timeout.ms";
121 };
122 
123 } } } // end of KAFKA_API::clients::producer
124 
Configuration for Kafka clients.
Definition: ClientConfig.h:14
Configuration for the Kafka Producer.
Definition: ProducerConfig.h:14
static constexpr const char * LINGER_MS
Delay in milliseconds to wait for messages in the producer queue, to accumulate before constructing m...
Definition: ProducerConfig.h:49
static constexpr const char * PARTITIONER
The default partitioner for a ProducerRecord (with no partition assigned).
Definition: ProducerConfig.h:97
static constexpr const char * REQUEST_TIMEOUT_MS
This value is only enforced by the brokers and relies on ACKS being non-zero.
Definition: ProducerConfig.h:82
static constexpr const char * TRANSACTIONAL_ID
It's used to identify the same transactional producer instance across process restarts.
Definition: ProducerConfig.h:114
static constexpr const char * MAX_IN_FLIGHT
Maximum number of in-flight requests per broker connection.
Definition: ProducerConfig.h:103
static constexpr const char * ENABLE_IDEMPOTENCE
When set to true, the producer will ensure that messages are succefully sent exactly once and in the ...
Definition: ProducerConfig.h:109
static constexpr const char * BATCH_NUM_MESSAGES
Maximum number of messages batched in one messageSet.
Definition: ProducerConfig.h:55
static constexpr const char * ACKS
The acks parameter controls how many partition replicas must receive the record before the producer c...
Definition: ProducerConfig.h:31
static constexpr const char * MESSAGE_TIMEOUT_MS
This value is enforced locally and limits the time a produced message waits for successful delivery.
Definition: ProducerConfig.h:75
static constexpr const char * MESSAGE_MAX_BYTES
Maximum Kafka protocol request message size.
Definition: ProducerConfig.h:68
static constexpr const char * TRANSACTION_TIMEOUT_MS
Th maximus amount of time in milliseconds that the transaction coordinator will wait for a trnsaction...
Definition: ProducerConfig.h:120
static constexpr const char * QUEUE_BUFFERING_MAX_MESSAGES
Maximum number of messages allowed on the producer queue.
Definition: ProducerConfig.h:37
static constexpr const char * BATCH_SIZE
Maximum size (in bytes) of all messages batched in one MessageSet (including protocol framing overhea...
Definition: ProducerConfig.h:61
static constexpr const char * QUEUE_BUFFERING_MAX_KBYTES
Maximum total message size sum allowed on the producer queue.
Definition: ProducerConfig.h:43