NATS C Client with JetStream and Streaming support  3.2.0
The nats.io C Client, Supported by Synadia Communications Inc.
JetStream

Modules

 JetStream Assets Management
 
 Publishing
 
 Subscribing
 
 Messages
 

Functions

NATS_EXTERN natsStatus jsOptions_Init (jsOptions *opts)
 Initializes a streaming context options structure. More...
 
NATS_EXTERN natsStatus natsConnection_JetStream (jsCtx **js, natsConnection *nc, jsOptions *opts)
 Returns a new JetStream context. More...
 
NATS_EXTERN void jsCtx_Destroy (jsCtx *js)
 Destroys the JetStream context. More...
 

Detailed Description

JetStream.

Function Documentation

◆ jsOptions_Init()

NATS_EXTERN natsStatus jsOptions_Init ( jsOptions opts)

Use this before setting specific stream context options and passing it to JetStream APIs.

Parameters
optsthe pointer to the jsOptions to initialize.

◆ natsConnection_JetStream()

NATS_EXTERN natsStatus natsConnection_JetStream ( jsCtx **  js,
natsConnection nc,
jsOptions opts 
)

A JetStream context is used for messaging and assets management.

Since the underlying NATS connection is used for communication, the NATS connection should stay valid while using the JetStream context. That is, do not close/destroy the NATS connection before destroying the JetStream context.

Note
When done, the context should be destroyed to release memory.
Parameters
jsthe location where to store the pointer to the newly created jsCtx object.
ncthe pointer to the natsConnection object from which to get the JetStream context.
optsthe pointer to the jsOptions object, possibly NULL.

◆ jsCtx_Destroy()

NATS_EXTERN void jsCtx_Destroy ( jsCtx js)

Releases memory used by the context object.

Parameters
jsthe pointer to the jsCtx object to destroy.