Function specific to JetStream messages
◆ natsMsg_GetMetaData()
This works only for JetStream messages that have been received through a subscription callback or calling natsSubscription_NextMsg.
- Note
- The user must destroy the returned object with jsMsgMetaData_Destroy.
-
This function will return an error for non JetStream messages.
- Parameters
-
| new_meta | the location where to store the pointer to the newly created jsMsgMetaData object. |
| msg | the pointer to the natsMsg object, which should be a JetStream message received through a subscription callback or natsSubscription_NextMsg. |
◆ jsMsgMetaData_Destroy()
Releases memory allocated for this jsMsgMetaData object.
- Parameters
-
◆ natsMsg_Ack()
This tells the server that the message was successfully processed and it can move on to the next message.
- Parameters
-
| msg | the pointer to the natsMsg object. |
| opts | the pointer to the jsOptions object, possibly NULL. |
◆ natsMsg_AckSync()
This is the synchronous version of natsMsg_Ack. This indicates successful message processing, and waits for confirmation from the server that the acknowledgment has been processed.
- Parameters
-
| msg | the pointer to the natsMsg object. |
| opts | the pointer to the jsOptions object, possibly NULL. |
| errCode | the location where to store the JetStream specific error code, or NULL if not needed. |
◆ natsMsg_Nak()
This tells the server to redeliver the message. You can configure the number of redeliveries by passing MaxDeliver when you subscribe.
The default is infinite redeliveries.
- Parameters
-
| msg | the pointer to the natsMsg object. |
| opts | the pointer to the jsOptions object, possibly NULL. |
◆ natsMsg_InProgress()
This tells the server that this message is being worked on. It resets the redelivery timer on the server.
- Parameters
-
| msg | the pointer to the natsMsg object. |
| opts | the pointer to the jsOptions object, possibly NULL. |
◆ natsMsg_Term()
This tells the server to not redeliver this message, regardless of the value MaxDeliver.
- Parameters
-
| msg | the pointer to the natsMsg object. |
| opts | the pointer to the jsOptions object, possibly NULL. |
◆ natsMsg_GetSequence()
Returns the sequence number of this JetStream message, or 0 if msg is NULL or not a JetStream message.
- Note
- This applies to JetStream messages retrieved with js_GetMsg or js_GetLastMsg.
- Parameters
-
| msg | the pointer to the natsMsg object. |
◆ natsMsg_GetTime()
Returns the timestamp (in UTC) of this JetStream message, or 0 if msg is NULL or not a JetStream message.
- Note
- This applies to JetStream messages retrieved with js_GetMsg or js_GetLastMsg.
- Parameters
-
| msg | the pointer to the natsMsg object. |