21#include <pulsar/defines.h>
27#include <pulsar/c/message.h>
28#include <pulsar/c/messages.h>
29#include <pulsar/c/result.h>
32typedef struct _pulsar_consumer pulsar_consumer_t;
34typedef void (*pulsar_result_callback)(pulsar_result,
void *);
36typedef void (*pulsar_receive_callback)(pulsar_result result, pulsar_message_t *msg,
void *ctx);
38typedef void (*pulsar_batch_receive_callback)(pulsar_result result, pulsar_messages_t *msgs,
void *ctx);
43PULSAR_PUBLIC
const char *pulsar_consumer_get_topic(pulsar_consumer_t *consumer);
48PULSAR_PUBLIC
const char *pulsar_consumer_get_subscription_name(pulsar_consumer_t *consumer);
63PULSAR_PUBLIC pulsar_result pulsar_consumer_unsubscribe(pulsar_consumer_t *consumer);
76PULSAR_PUBLIC
void pulsar_consumer_unsubscribe_async(pulsar_consumer_t *consumer,
77 pulsar_result_callback callback,
void *ctx);
89PULSAR_PUBLIC pulsar_result pulsar_consumer_receive(pulsar_consumer_t *consumer, pulsar_message_t **msg);
99PULSAR_PUBLIC pulsar_result pulsar_consumer_receive_with_timeout(pulsar_consumer_t *consumer,
100 pulsar_message_t **msg,
int timeoutMs);
110PULSAR_PUBLIC
void pulsar_consumer_receive_async(pulsar_consumer_t *consumer,
111 pulsar_receive_callback callback,
void *ctx);
121PULSAR_PUBLIC pulsar_result pulsar_consumer_batch_receive(pulsar_consumer_t *consumer,
122 pulsar_messages_t **msgs);
132PULSAR_PUBLIC
void pulsar_consumer_batch_receive_async(pulsar_consumer_t *consumer,
133 pulsar_batch_receive_callback callback,
void *ctx);
146PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge(pulsar_consumer_t *consumer,
147 pulsar_message_t *message);
149PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge_id(pulsar_consumer_t *consumer,
150 pulsar_message_id_t *messageId);
161PULSAR_PUBLIC
void pulsar_consumer_acknowledge_async(pulsar_consumer_t *consumer, pulsar_message_t *message,
162 pulsar_result_callback callback,
void *ctx);
164PULSAR_PUBLIC
void pulsar_consumer_acknowledge_async_id(pulsar_consumer_t *consumer,
165 pulsar_message_id_t *messageId,
166 pulsar_result_callback callback,
void *ctx);
185PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge_cumulative(pulsar_consumer_t *consumer,
186 pulsar_message_t *message);
188PULSAR_PUBLIC pulsar_result pulsar_consumer_acknowledge_cumulative_id(pulsar_consumer_t *consumer,
189 pulsar_message_id_t *messageId);
201PULSAR_PUBLIC
void pulsar_consumer_acknowledge_cumulative_async(pulsar_consumer_t *consumer,
202 pulsar_message_t *message,
203 pulsar_result_callback callback,
void *ctx);
205PULSAR_PUBLIC
void pulsar_consumer_acknowledge_cumulative_async_id(pulsar_consumer_t *consumer,
206 pulsar_message_id_t *messageId,
207 pulsar_result_callback callback,
222PULSAR_PUBLIC
void pulsar_consumer_negative_acknowledge(pulsar_consumer_t *consumer,
223 pulsar_message_t *message);
237PULSAR_PUBLIC
void pulsar_consumer_negative_acknowledge_id(pulsar_consumer_t *consumer,
238 pulsar_message_id_t *messageId);
240PULSAR_PUBLIC pulsar_result pulsar_consumer_close(pulsar_consumer_t *consumer);
242PULSAR_PUBLIC
void pulsar_consumer_close_async(pulsar_consumer_t *consumer, pulsar_result_callback callback,
245PULSAR_PUBLIC
void pulsar_consumer_free(pulsar_consumer_t *consumer);
250PULSAR_PUBLIC pulsar_result pulsar_consumer_pause_message_listener(pulsar_consumer_t *consumer);
256PULSAR_PUBLIC pulsar_result resume_message_listener(pulsar_consumer_t *consumer);
267PULSAR_PUBLIC
void pulsar_consumer_redeliver_unacknowledged_messages(pulsar_consumer_t *consumer);
278PULSAR_PUBLIC
void pulsar_consumer_seek_async(pulsar_consumer_t *consumer, pulsar_message_id_t *messageId,
279 pulsar_result_callback callback,
void *ctx);
289PULSAR_PUBLIC pulsar_result pulsar_consumer_seek(pulsar_consumer_t *consumer, pulsar_message_id_t *messageId);
300PULSAR_PUBLIC
void pulsar_consumer_seek_by_timestamp_async(pulsar_consumer_t *consumer, uint64_t timestamp,
301 pulsar_result_callback callback,
void *ctx);
311PULSAR_PUBLIC pulsar_result pulsar_consumer_seek_by_timestamp(pulsar_consumer_t *consumer,
314PULSAR_PUBLIC
int pulsar_consumer_is_connected(pulsar_consumer_t *consumer);
316PULSAR_PUBLIC pulsar_result pulsar_consumer_get_last_message_id(pulsar_consumer_t *consumer,
317 pulsar_message_id_t *messageId);