22#include <pulsar/c/message_router.h>
23#include <pulsar/defines.h>
32 pulsar_UseSinglePartition,
33 pulsar_RoundRobinDistribution,
34 pulsar_CustomPartition
35} pulsar_partitions_routing_mode;
39 pulsar_Murmur3_32Hash,
42} pulsar_hashing_scheme;
46 pulsar_CompressionNone = 0,
47 pulsar_CompressionLZ4 = 1,
48 pulsar_CompressionZLib = 2,
49 pulsar_CompressionZSTD = 3,
50 pulsar_CompressionSNAPPY = 4
51} pulsar_compression_type;
69 pulsar_AutoConsume = -3,
70 pulsar_AutoPublish = -4,
79} pulsar_producer_crypto_failure_action;
84 pulsar_ProducerAccessModeShared = 0,
87 pulsar_ProducerAccessModeExclusive = 1,
89 pulsar_ProducerAccessModeWaitForExclusive = 2,
92 pulsar_ProducerAccessModeExclusiveWithFencing = 3
94} pulsar_producer_access_mode;
96typedef struct _pulsar_producer_configuration pulsar_producer_configuration_t;
98typedef struct _pulsar_crypto_key_reader pulsar_crypto_key_reader;
100PULSAR_PUBLIC pulsar_producer_configuration_t *pulsar_producer_configuration_create();
102PULSAR_PUBLIC
void pulsar_producer_configuration_free(pulsar_producer_configuration_t *conf);
104PULSAR_PUBLIC
void pulsar_producer_configuration_set_producer_name(pulsar_producer_configuration_t *conf,
105 const char *producerName);
107PULSAR_PUBLIC
const char *pulsar_producer_configuration_get_producer_name(
108 pulsar_producer_configuration_t *conf);
110PULSAR_PUBLIC
void pulsar_producer_configuration_set_send_timeout(pulsar_producer_configuration_t *conf,
113PULSAR_PUBLIC
int pulsar_producer_configuration_get_send_timeout(pulsar_producer_configuration_t *conf);
115PULSAR_PUBLIC
void pulsar_producer_configuration_set_initial_sequence_id(
116 pulsar_producer_configuration_t *conf, int64_t initialSequenceId);
119pulsar_producer_configuration_get_initial_sequence_id(pulsar_producer_configuration_t *conf);
121PULSAR_PUBLIC
void pulsar_producer_configuration_set_compression_type(
122 pulsar_producer_configuration_t *conf, pulsar_compression_type compressionType);
124PULSAR_PUBLIC pulsar_compression_type
125pulsar_producer_configuration_get_compression_type(pulsar_producer_configuration_t *conf);
127PULSAR_PUBLIC
void pulsar_producer_configuration_set_schema_info(pulsar_producer_configuration_t *conf,
128 pulsar_schema_type schemaType,
129 const char *name,
const char *schema,
130 pulsar_string_map_t *properties);
132PULSAR_PUBLIC
void pulsar_producer_configuration_set_max_pending_messages(
133 pulsar_producer_configuration_t *conf,
int maxPendingMessages);
134PULSAR_PUBLIC
int pulsar_producer_configuration_get_max_pending_messages(
135 pulsar_producer_configuration_t *conf);
145PULSAR_PUBLIC
void pulsar_producer_configuration_set_max_pending_messages_across_partitions(
146 pulsar_producer_configuration_t *conf,
int maxPendingMessagesAcrossPartitions);
152PULSAR_PUBLIC
int pulsar_producer_configuration_get_max_pending_messages_across_partitions(
153 pulsar_producer_configuration_t *conf);
155PULSAR_PUBLIC
void pulsar_producer_configuration_set_partitions_routing_mode(
156 pulsar_producer_configuration_t *conf, pulsar_partitions_routing_mode mode);
158PULSAR_PUBLIC pulsar_partitions_routing_mode
159pulsar_producer_configuration_get_partitions_routing_mode(pulsar_producer_configuration_t *conf);
161PULSAR_PUBLIC
void pulsar_producer_configuration_set_message_router(pulsar_producer_configuration_t *conf,
162 pulsar_message_router router,
void *ctx);
164PULSAR_PUBLIC
void pulsar_producer_configuration_set_hashing_scheme(pulsar_producer_configuration_t *conf,
165 pulsar_hashing_scheme scheme);
167PULSAR_PUBLIC pulsar_hashing_scheme
168pulsar_producer_configuration_get_hashing_scheme(pulsar_producer_configuration_t *conf);
170PULSAR_PUBLIC
void pulsar_producer_configuration_set_lazy_start_partitioned_producers(
171 pulsar_producer_configuration_t *conf,
int useLazyStartPartitionedProducers);
173PULSAR_PUBLIC
int pulsar_producer_configuration_get_lazy_start_partitioned_producers(
174 pulsar_producer_configuration_t *conf);
176PULSAR_PUBLIC
void pulsar_producer_configuration_set_block_if_queue_full(
177 pulsar_producer_configuration_t *conf,
int blockIfQueueFull);
179PULSAR_PUBLIC
int pulsar_producer_configuration_get_block_if_queue_full(
180 pulsar_producer_configuration_t *conf);
183PULSAR_PUBLIC
void pulsar_producer_configuration_set_batching_enabled(pulsar_producer_configuration_t *conf,
184 int batchingEnabled);
186PULSAR_PUBLIC
int pulsar_producer_configuration_get_batching_enabled(pulsar_producer_configuration_t *conf);
188PULSAR_PUBLIC
void pulsar_producer_configuration_set_batching_max_messages(
189 pulsar_producer_configuration_t *conf,
unsigned int batchingMaxMessages);
191PULSAR_PUBLIC
unsigned int pulsar_producer_configuration_get_batching_max_messages(
192 pulsar_producer_configuration_t *conf);
194PULSAR_PUBLIC
void pulsar_producer_configuration_set_batching_max_allowed_size_in_bytes(
195 pulsar_producer_configuration_t *conf,
unsigned long batchingMaxAllowedSizeInBytes);
197PULSAR_PUBLIC
unsigned long pulsar_producer_configuration_get_batching_max_allowed_size_in_bytes(
198 pulsar_producer_configuration_t *conf);
200PULSAR_PUBLIC
void pulsar_producer_configuration_set_batching_max_publish_delay_ms(
201 pulsar_producer_configuration_t *conf,
unsigned long batchingMaxPublishDelayMs);
203PULSAR_PUBLIC
unsigned long pulsar_producer_configuration_get_batching_max_publish_delay_ms(
204 pulsar_producer_configuration_t *conf);
206PULSAR_PUBLIC
void pulsar_producer_configuration_set_property(pulsar_producer_configuration_t *conf,
207 const char *name,
const char *value);
209PULSAR_PUBLIC
int pulsar_producer_is_encryption_enabled(pulsar_producer_configuration_t *conf);
211PULSAR_PUBLIC
void pulsar_producer_configuration_set_default_crypto_key_reader(
212 pulsar_producer_configuration_t *conf,
const char *public_key_path,
const char *private_key_path);
214PULSAR_PUBLIC pulsar_producer_crypto_failure_action
215pulsar_producer_configuration_get_crypto_failure_action(pulsar_producer_configuration_t *conf);
217PULSAR_PUBLIC
void pulsar_producer_configuration_set_crypto_failure_action(
218 pulsar_producer_configuration_t *conf, pulsar_producer_crypto_failure_action cryptoFailureAction);
220PULSAR_PUBLIC
void pulsar_producer_configuration_set_encryption_key(pulsar_producer_configuration_t *conf,
223PULSAR_PUBLIC
void pulsar_producer_configuration_set_chunking_enabled(pulsar_producer_configuration_t *conf,
224 int chunkingEnabled);
226PULSAR_PUBLIC
int pulsar_producer_configuration_is_chunking_enabled(pulsar_producer_configuration_t *conf);
228PULSAR_PUBLIC pulsar_producer_access_mode
229pulsar_producer_configuration_get_access_mode(pulsar_producer_configuration_t *conf);
231PULSAR_PUBLIC
void pulsar_producer_configuration_set_access_mode(pulsar_producer_configuration_t *conf,
232 pulsar_producer_access_mode accessMode);