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

Functions
microClient
EXPERIMENTAL - Microservices » Functions

## Functions
NATS_EXTERN microError * | micro_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 microError * | microClient_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_client | received the pointer to the new client.
  nc | a NATS connection.
  cfg | for future use, use NULL for now.

Returns
  a microError if an error occurred.

## ◆ microClient_Destroy()

NATS_EXTERN void microClient_Destroy | ( | microClient * | client | ) |

Parameters

  client | the client to destroy.

## ◆ microClient_DoRequest()

NATS_EXTERN microError* microClient_DoRequest | ( | natsMsg ** | reply,
|  | microClient * | client,
|  | const char * | subject,
|  | const char * | data,
|  | int | data_len
| ) |  |

Parameters

  reply | receives the pointer to the response NATS message. `reply` must be freed with natsMsg_Destroy.
  client | the client to use.
  subject | the subject to send the request on.
  data | the request data.
  data_len | the request data length.

Returns
  a microError if an error occurred.