26#include <pulsar/defines.h>
30#include "string_map.h"
32typedef struct _pulsar_message pulsar_message_t;
33typedef struct _pulsar_message_id pulsar_message_id_t;
35PULSAR_PUBLIC pulsar_message_t *pulsar_message_create();
44PULSAR_PUBLIC
void pulsar_message_copy(
const pulsar_message_t *from, pulsar_message_t *to);
45PULSAR_PUBLIC
void pulsar_message_free(pulsar_message_t *message);
49PULSAR_PUBLIC
void pulsar_message_set_content(pulsar_message_t *message,
const void *data,
size_t size);
56PULSAR_PUBLIC
void pulsar_message_set_allocated_content(pulsar_message_t *message,
void *data,
size_t size);
58PULSAR_PUBLIC
void pulsar_message_set_property(pulsar_message_t *message,
const char *name,
65PULSAR_PUBLIC
void pulsar_message_set_partition_key(pulsar_message_t *message,
const char *partitionKey);
71PULSAR_PUBLIC
void pulsar_message_set_ordering_key(pulsar_message_t *message,
const char *orderingKey);
76PULSAR_PUBLIC
void pulsar_message_set_event_timestamp(pulsar_message_t *message, uint64_t eventTimestamp);
93PULSAR_PUBLIC
void pulsar_message_set_sequence_id(pulsar_message_t *message, int64_t sequenceId);
100PULSAR_PUBLIC
void pulsar_message_set_deliver_after(pulsar_message_t *message, uint64_t delayMillis);
108PULSAR_PUBLIC
void pulsar_message_set_deliver_at(pulsar_message_t *message, uint64_t deliveryTimestampMillis);
120PULSAR_PUBLIC
void pulsar_message_set_replication_clusters(pulsar_message_t *message,
const char **clusters,
128PULSAR_PUBLIC
void pulsar_message_disable_replication(pulsar_message_t *message,
int flag);
138PULSAR_PUBLIC pulsar_string_map_t *pulsar_message_get_properties(pulsar_message_t *message);
147PULSAR_PUBLIC
int pulsar_message_has_property(pulsar_message_t *message,
const char *name);
155PULSAR_PUBLIC
const char *pulsar_message_get_property(pulsar_message_t *message,
const char *name);
163PULSAR_PUBLIC
const void *pulsar_message_get_data(pulsar_message_t *message);
170PULSAR_PUBLIC uint32_t pulsar_message_get_length(pulsar_message_t *message);
181PULSAR_PUBLIC pulsar_message_id_t *pulsar_message_get_message_id(pulsar_message_t *message);
187PULSAR_PUBLIC
const char *pulsar_message_get_partitionKey(pulsar_message_t *message);
188PULSAR_PUBLIC
int pulsar_message_has_partition_key(pulsar_message_t *message);
194PULSAR_PUBLIC
const char *pulsar_message_get_orderingKey(pulsar_message_t *message);
195PULSAR_PUBLIC
int pulsar_message_has_ordering_key(pulsar_message_t *message);
201PULSAR_PUBLIC uint64_t pulsar_message_get_publish_timestamp(pulsar_message_t *message);
206PULSAR_PUBLIC uint64_t pulsar_message_get_event_timestamp(pulsar_message_t *message);
208PULSAR_PUBLIC
const char *pulsar_message_get_topic_name(pulsar_message_t *message);
210PULSAR_PUBLIC
int pulsar_message_get_redelivery_count(pulsar_message_t *message);
212PULSAR_PUBLIC
int pulsar_message_has_schema_version(pulsar_message_t *message);
214PULSAR_PUBLIC
const char *pulsar_message_get_schemaVersion(pulsar_message_t *message);
216PULSAR_PUBLIC
void pulsar_message_set_schema_version(pulsar_message_t *message,
const char *schemaVersion);