22#include <pulsar/c/client_configuration.h>
23#include <pulsar/c/consumer.h>
24#include <pulsar/c/consumer_configuration.h>
25#include <pulsar/c/message.h>
26#include <pulsar/c/message_id.h>
27#include <pulsar/c/producer.h>
28#include <pulsar/c/producer_configuration.h>
29#include <pulsar/c/reader.h>
30#include <pulsar/c/reader_configuration.h>
31#include <pulsar/c/result.h>
32#include <pulsar/c/string_list.h>
33#include <pulsar/c/table_view.h>
34#include <pulsar/c/table_view_configuration.h>
35#include <pulsar/defines.h>
41typedef struct _pulsar_client pulsar_client_t;
42typedef struct _pulsar_producer pulsar_producer_t;
43typedef struct _pulsar_string_list pulsar_string_list_t;
45typedef struct _pulsar_client_configuration pulsar_client_configuration_t;
46typedef struct _pulsar_producer_configuration pulsar_producer_configuration_t;
48typedef void (*pulsar_create_producer_callback)(pulsar_result result, pulsar_producer_t *producer,
void *ctx);
50typedef void (*pulsar_subscribe_callback)(pulsar_result result, pulsar_consumer_t *consumer,
void *ctx);
51typedef void (*pulsar_reader_callback)(pulsar_result result, pulsar_reader_t *reader,
void *ctx);
52typedef void (*pulsar_table_view_callback)(pulsar_result result, pulsar_table_view_t *tableView,
void *ctx);
53typedef void (*pulsar_get_partitions_callback)(pulsar_result result, pulsar_string_list_t *partitions,
56typedef void (*pulsar_close_callback)(pulsar_result result,
void *ctx);
65PULSAR_PUBLIC pulsar_client_t *pulsar_client_create(
const char *serviceUrl,
66 const pulsar_client_configuration_t *clientConfiguration);
78PULSAR_PUBLIC pulsar_result pulsar_client_create_producer(pulsar_client_t *client,
const char *topic,
79 const pulsar_producer_configuration_t *conf,
80 pulsar_producer_t **producer);
82PULSAR_PUBLIC
void pulsar_client_create_producer_async(pulsar_client_t *client,
const char *topic,
83 const pulsar_producer_configuration_t *conf,
84 pulsar_create_producer_callback callback,
void *ctx);
86PULSAR_PUBLIC pulsar_result pulsar_client_subscribe(pulsar_client_t *client,
const char *topic,
87 const char *subscriptionName,
88 const pulsar_consumer_configuration_t *conf,
89 pulsar_consumer_t **consumer);
91PULSAR_PUBLIC
void pulsar_client_subscribe_async(pulsar_client_t *client,
const char *topic,
92 const char *subscriptionName,
93 const pulsar_consumer_configuration_t *conf,
94 pulsar_subscribe_callback callback,
void *ctx);
108PULSAR_PUBLIC pulsar_result pulsar_client_subscribe_multi_topics(pulsar_client_t *client,
const char **topics,
110 const char *subscriptionName,
111 const pulsar_consumer_configuration_t *conf,
112 pulsar_consumer_t **consumer);
114PULSAR_PUBLIC
void pulsar_client_subscribe_multi_topics_async(pulsar_client_t *client,
const char **topics,
115 int topicsCount,
const char *subscriptionName,
116 const pulsar_consumer_configuration_t *conf,
117 pulsar_subscribe_callback callback,
void *ctx);
130PULSAR_PUBLIC pulsar_result pulsar_client_subscribe_pattern(pulsar_client_t *client,
const char *topicPattern,
131 const char *subscriptionName,
132 const pulsar_consumer_configuration_t *conf,
133 pulsar_consumer_t **consumer);
135PULSAR_PUBLIC
void pulsar_client_subscribe_pattern_async(pulsar_client_t *client,
const char *topicPattern,
136 const char *subscriptionName,
137 const pulsar_consumer_configuration_t *conf,
138 pulsar_subscribe_callback callback,
void *ctx);
169PULSAR_PUBLIC pulsar_result pulsar_client_create_reader(pulsar_client_t *client,
const char *topic,
170 const pulsar_message_id_t *startMessageId,
171 pulsar_reader_configuration_t *conf,
172 pulsar_reader_t **reader);
174PULSAR_PUBLIC
void pulsar_client_create_reader_async(pulsar_client_t *client,
const char *topic,
175 const pulsar_message_id_t *startMessageId,
176 pulsar_reader_configuration_t *conf,
177 pulsar_reader_callback callback,
void *ctx);
209PULSAR_PUBLIC pulsar_result pulsar_client_create_table_view(pulsar_client_t *client,
const char *topic,
210 pulsar_table_view_configuration_t *conf,
211 pulsar_table_view_t **c_tableView);
223PULSAR_PUBLIC
void pulsar_client_create_table_view_async(pulsar_client_t *client,
const char *topic,
224 pulsar_table_view_configuration_t *conf,
225 pulsar_table_view_callback callback,
void *ctx);
227PULSAR_PUBLIC pulsar_result pulsar_client_get_topic_partitions(pulsar_client_t *client,
const char *topic,
228 pulsar_string_list_t **partitions);
230PULSAR_PUBLIC
void pulsar_client_get_topic_partitions_async(pulsar_client_t *client,
const char *topic,
231 pulsar_get_partitions_callback callback,
234PULSAR_PUBLIC pulsar_result pulsar_client_close(pulsar_client_t *client);
236PULSAR_PUBLIC
void pulsar_client_close_async(pulsar_client_t *client, pulsar_close_callback callback,
239PULSAR_PUBLIC
void pulsar_client_free(pulsar_client_t *client);