NATS C Client with JetStream and Streaming support
3.9.1
The nats.io C Client, Supported by Synadia Communications Inc.
|
Functions | |
NATS_EXTERN uint64_t | stanMsg_GetSequence (const stanMsg *msg) |
Returns the message's sequence number. More... | |
NATS_EXTERN int64_t | stanMsg_GetTimestamp (const stanMsg *msg) |
Returns the message's timestamp. More... | |
NATS_EXTERN bool | stanMsg_IsRedelivered (const stanMsg *msg) |
Returns the message's redelivered flag. More... | |
NATS_EXTERN const char * | stanMsg_GetData (const stanMsg *msg) |
Returns the message payload. More... | |
NATS_EXTERN int | stanMsg_GetDataLength (const stanMsg *msg) |
Returns the message length. More... | |
NATS_EXTERN void | stanMsg_Destroy (stanMsg *msg) |
Destroys the message object. More... | |
NATS Streaming Message.
NATS_EXTERN uint64_t stanMsg_GetSequence | ( | const stanMsg * | msg | ) |
Returns the message's sequence number (as assigned by the cluster).
msg | the pointer to the stanMsg object. |
NATS_EXTERN int64_t stanMsg_GetTimestamp | ( | const stanMsg * | msg | ) |
Returns the message's timestamp (as assigned by the cluster).
msg | the pointer to the stanMsg object. |
NATS_EXTERN bool stanMsg_IsRedelivered | ( | const stanMsg * | msg | ) |
Returns the message's redelivered flag. This can help detect if this message is a possible duplicate (due to redelivery and at-least-once semantic).
msg | the pointer to the stanMsg object. |
NATS_EXTERN const char* stanMsg_GetData | ( | const stanMsg * | msg | ) |
Returns the message payload, possibly NULL
.
Note that although the data sent and received from the server is not NULL
terminated, the NATS C Client does add a NULL
byte to the received payload. If you expect the received data to be a "string", then this conveniently allows you to call stanMsg_GetData() without having to copy the returned data to a buffer to add the NULL
byte at the end.
msg | the pointer to the stanMsg object. |
NATS_EXTERN int stanMsg_GetDataLength | ( | const stanMsg * | msg | ) |
Returns the message's payload length, possibly 0.
msg | the pointer to the stanMsg object. |
NATS_EXTERN void stanMsg_Destroy | ( | stanMsg * | msg | ) |
Destroys the message, freeing memory.
msg | the pointer to the stanMsg object to destroy. |