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

Functions

NATS_EXTERN microErrormicro_NewClient (microClient **new_client, natsConnection *nc, microClientConfig *cfg)
 Creates a new microservice client. More...
 
NATS_EXTERN void microClient_Destroy (microClient *client)
 Destroys a microservice client. More...
 
NATS_EXTERN microErrormicroClient_DoRequest (natsMsg **reply, microClient *client, const char *subject, const char *data, int data_len)
 Sends a request to a microservice and receives the response. More...
 

Detailed Description

Function Documentation

◆ micro_NewClient()

NATS_EXTERN microError* micro_NewClient ( microClient **  new_client,
natsConnection nc,
microClientConfig cfg 
)
Parameters
new_clientreceived the pointer to the new client.
nca NATS connection.
cfgfor future use, use NULL for now.
Returns
a microError if an error occurred.

◆ microClient_Destroy()

NATS_EXTERN void microClient_Destroy ( microClient client)
Parameters
clientthe client to destroy.

◆ microClient_DoRequest()

NATS_EXTERN microError* microClient_DoRequest ( natsMsg **  reply,
microClient client,
const char *  subject,
const char *  data,
int  data_len 
)
Parameters
replyreceives the pointer to the response NATS message. reply must be freed with natsMsg_Destroy.
clientthe client to use.
subjectthe subject to send the request on.
datathe request data.
data_lenthe request data length.
Returns
a microError if an error occurred.