21#include <pulsar/defines.h>
24#include "producer_configuration.h"
30typedef struct _pulsar_consumer_configuration pulsar_consumer_configuration_t;
37 pulsar_ConsumerExclusive,
43 pulsar_ConsumerShared,
48 pulsar_ConsumerFailover,
54 pulsar_ConsumerKeyShared
55} pulsar_consumer_type;
62 initial_position_latest,
66 initial_position_earliest
74 pulsar_ConsumerDiscard,
79 pulsar_ConsumerConsume
80} pulsar_consumer_crypto_failure_action;
85 pulsar_consumer_regex_sub_mode_PersistentOnly = 0,
87 pulsar_consumer_regex_sub_mode_NonPersistentOnly = 1,
89 pulsar_consumer_regex_sub_mode_AllTopics = 2
90} pulsar_consumer_regex_subscription_mode;
106 const char *dead_letter_topic;
109 int max_redeliver_count;
114 const char *initial_subscription_name;
118typedef void (*pulsar_message_listener)(pulsar_consumer_t *consumer, pulsar_message_t *msg,
void *ctx);
120PULSAR_PUBLIC pulsar_consumer_configuration_t *pulsar_consumer_configuration_create();
122PULSAR_PUBLIC
void pulsar_consumer_configuration_free(
123 pulsar_consumer_configuration_t *consumer_configuration);
137PULSAR_PUBLIC
void pulsar_consumer_configuration_set_consumer_type(
138 pulsar_consumer_configuration_t *consumer_configuration, pulsar_consumer_type consumerType);
140PULSAR_PUBLIC pulsar_consumer_type
141pulsar_consumer_configuration_get_consumer_type(pulsar_consumer_configuration_t *consumer_configuration);
143PULSAR_PUBLIC
void pulsar_consumer_configuration_set_schema_info(
144 pulsar_consumer_configuration_t *consumer_configuration, pulsar_schema_type schemaType,
const char *name,
145 const char *schema, pulsar_string_map_t *properties);
152PULSAR_PUBLIC
void pulsar_consumer_configuration_set_message_listener(
153 pulsar_consumer_configuration_t *consumer_configuration, pulsar_message_listener messageListener,
156PULSAR_PUBLIC
int pulsar_consumer_configuration_has_message_listener(
157 pulsar_consumer_configuration_t *consumer_configuration);
180PULSAR_PUBLIC
void pulsar_consumer_configuration_set_receiver_queue_size(
181 pulsar_consumer_configuration_t *consumer_configuration,
int size);
183PULSAR_PUBLIC
int pulsar_consumer_configuration_get_receiver_queue_size(
184 pulsar_consumer_configuration_t *consumer_configuration);
194PULSAR_PUBLIC
void pulsar_consumer_set_max_total_receiver_queue_size_across_partitions(
195 pulsar_consumer_configuration_t *consumer_configuration,
int maxTotalReceiverQueueSizeAcrossPartitions);
200PULSAR_PUBLIC
int pulsar_consumer_get_max_total_receiver_queue_size_across_partitions(
201 pulsar_consumer_configuration_t *consumer_configuration);
203PULSAR_PUBLIC
void pulsar_consumer_set_consumer_name(pulsar_consumer_configuration_t *consumer_configuration,
204 const char *consumerName);
206PULSAR_PUBLIC
const char *pulsar_consumer_get_consumer_name(
207 pulsar_consumer_configuration_t *consumer_configuration);
216PULSAR_PUBLIC
void pulsar_consumer_set_unacked_messages_timeout_ms(
217 pulsar_consumer_configuration_t *consumer_configuration,
const uint64_t milliSeconds);
222PULSAR_PUBLIC
long pulsar_consumer_get_unacked_messages_timeout_ms(
223 pulsar_consumer_configuration_t *consumer_configuration);
237PULSAR_PUBLIC
void pulsar_configure_set_negative_ack_redelivery_delay_ms(
238 pulsar_consumer_configuration_t *consumer_configuration,
long redeliveryDelayMillis);
246PULSAR_PUBLIC
long pulsar_configure_get_negative_ack_redelivery_delay_ms(
247 pulsar_consumer_configuration_t *consumer_configuration);
258PULSAR_PUBLIC
void pulsar_configure_set_ack_grouping_time_ms(
259 pulsar_consumer_configuration_t *consumer_configuration,
long ackGroupingMillis);
267PULSAR_PUBLIC
long pulsar_configure_get_ack_grouping_time_ms(
268 pulsar_consumer_configuration_t *consumer_configuration);
277PULSAR_PUBLIC
void pulsar_configure_set_ack_grouping_max_size(
278 pulsar_consumer_configuration_t *consumer_configuration,
long maxGroupingSize);
286PULSAR_PUBLIC
long pulsar_configure_get_ack_grouping_max_size(
287 pulsar_consumer_configuration_t *consumer_configuration);
289PULSAR_PUBLIC
int pulsar_consumer_is_encryption_enabled(
290 pulsar_consumer_configuration_t *consumer_configuration);
292PULSAR_PUBLIC
void pulsar_consumer_configuration_set_default_crypto_key_reader(
293 pulsar_consumer_configuration_t *consumer_configuration,
const char *public_key_path,
294 const char *private_key_path);
296PULSAR_PUBLIC pulsar_consumer_crypto_failure_action pulsar_consumer_configuration_get_crypto_failure_action(
297 pulsar_consumer_configuration_t *consumer_configuration);
299PULSAR_PUBLIC
void pulsar_consumer_configuration_set_crypto_failure_action(
300 pulsar_consumer_configuration_t *consumer_configuration,
301 pulsar_consumer_crypto_failure_action cryptoFailureAction);
303PULSAR_PUBLIC
int pulsar_consumer_is_read_compacted(pulsar_consumer_configuration_t *consumer_configuration);
305PULSAR_PUBLIC
void pulsar_consumer_set_read_compacted(pulsar_consumer_configuration_t *consumer_configuration,
308PULSAR_PUBLIC
int pulsar_consumer_get_subscription_initial_position(
309 pulsar_consumer_configuration_t *consumer_configuration);
311PULSAR_PUBLIC
void pulsar_consumer_set_subscription_initial_position(
312 pulsar_consumer_configuration_t *consumer_configuration, initial_position subscriptionInitialPosition);
314PULSAR_PUBLIC
void pulsar_consumer_configuration_set_property(pulsar_consumer_configuration_t *conf,
315 const char *name,
const char *value);
317PULSAR_PUBLIC
void pulsar_consumer_configuration_set_priority_level(
318 pulsar_consumer_configuration_t *consumer_configuration,
int priority_level);
320PULSAR_PUBLIC
int pulsar_consumer_configuration_get_priority_level(
321 pulsar_consumer_configuration_t *consumer_configuration);
323PULSAR_PUBLIC
void pulsar_consumer_configuration_set_max_pending_chunked_message(
324 pulsar_consumer_configuration_t *consumer_configuration,
int max_pending_chunked_message);
326PULSAR_PUBLIC
int pulsar_consumer_configuration_get_max_pending_chunked_message(
327 pulsar_consumer_configuration_t *consumer_configuration);
329PULSAR_PUBLIC
void pulsar_consumer_configuration_set_auto_ack_oldest_chunked_message_on_queue_full(
330 pulsar_consumer_configuration_t *consumer_configuration,
331 int auto_ack_oldest_chunked_message_on_queue_full);
333PULSAR_PUBLIC
int pulsar_consumer_configuration_is_auto_ack_oldest_chunked_message_on_queue_full(
334 pulsar_consumer_configuration_t *consumer_configuration);
336PULSAR_PUBLIC
void pulsar_consumer_configuration_set_start_message_id_inclusive(
337 pulsar_consumer_configuration_t *consumer_configuration,
int start_message_id_inclusive);
339PULSAR_PUBLIC
int pulsar_consumer_configuration_is_start_message_id_inclusive(
340 pulsar_consumer_configuration_t *consumer_configuration);
342PULSAR_PUBLIC
void pulsar_consumer_configuration_set_batch_index_ack_enabled(
343 pulsar_consumer_configuration_t *consumer_configuration,
int enabled);
345PULSAR_PUBLIC
int pulsar_consumer_configuration_is_batch_index_ack_enabled(
346 pulsar_consumer_configuration_t *consumer_configuration);
348PULSAR_PUBLIC
void pulsar_consumer_configuration_set_regex_subscription_mode(
349 pulsar_consumer_configuration_t *consumer_configuration,
350 pulsar_consumer_regex_subscription_mode regex_sub_mode);
352PULSAR_PUBLIC pulsar_consumer_regex_subscription_mode
353pulsar_consumer_configuration_get_regex_subscription_mode(
354 pulsar_consumer_configuration_t *consumer_configuration);
367PULSAR_PUBLIC
int pulsar_consumer_configuration_set_batch_receive_policy(
368 pulsar_consumer_configuration_t *consumer_configuration,
383PULSAR_PUBLIC
void pulsar_consumer_configuration_get_batch_receive_policy(
384 pulsar_consumer_configuration_t *consumer_configuration,
387PULSAR_PUBLIC
void pulsar_consumer_configuration_set_dlq_policy(
388 pulsar_consumer_configuration_t *consumer_configuration,
399PULSAR_PUBLIC
void pulsar_consumer_configuration_get_dlq_policy(
400 pulsar_consumer_configuration_t *consumer_configuration,
Definition consumer_configuration.h:94
Definition consumer_configuration.h:103