pulsar-client-cpp
Loading...
Searching...
No Matches
client.h
1
20#pragma once
21
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>
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41typedef struct _pulsar_client pulsar_client_t;
42typedef struct _pulsar_producer pulsar_producer_t;
43typedef struct _pulsar_string_list pulsar_string_list_t;
44
45typedef struct _pulsar_client_configuration pulsar_client_configuration_t;
46typedef struct _pulsar_producer_configuration pulsar_producer_configuration_t;
47
48typedef void (*pulsar_create_producer_callback)(pulsar_result result, pulsar_producer_t *producer, void *ctx);
49
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,
54 void *ctx);
55
56typedef void (*pulsar_close_callback)(pulsar_result result, void *ctx);
57
65PULSAR_PUBLIC pulsar_client_t *pulsar_client_create(const char *serviceUrl,
66 const pulsar_client_configuration_t *clientConfiguration);
67
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);
81
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);
85
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);
90
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);
95
108PULSAR_PUBLIC pulsar_result pulsar_client_subscribe_multi_topics(pulsar_client_t *client, const char **topics,
109 int topicsCount,
110 const char *subscriptionName,
111 const pulsar_consumer_configuration_t *conf,
112 pulsar_consumer_t **consumer);
113
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);
118
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);
134
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);
139
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);
173
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);
212
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);
226
227PULSAR_PUBLIC pulsar_result pulsar_client_get_topic_partitions(pulsar_client_t *client, const char *topic,
228 pulsar_string_list_t **partitions);
229
230PULSAR_PUBLIC void pulsar_client_get_topic_partitions_async(pulsar_client_t *client, const char *topic,
231 pulsar_get_partitions_callback callback,
232 void *ctx);
233
234PULSAR_PUBLIC pulsar_result pulsar_client_close(pulsar_client_t *client);
235
236PULSAR_PUBLIC void pulsar_client_close_async(pulsar_client_t *client, pulsar_close_callback callback,
237 void *ctx);
238
239PULSAR_PUBLIC void pulsar_client_free(pulsar_client_t *client);
240
241#ifdef __cplusplus
242}
243#endif