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

Public Attributes | List of all members
micro_service_config_s Struct Reference
EXPERIMENTAL - Microservices » Public structs

The Microservice top-level configuration object. More...

`#include <nats.h>`

## Public Attributes
const char * | Name
| The name of the service. More...
const char * | Version
| The (semantic) version of the service. More...
const char * | Description
| The description of the service. More...
const char * | QueueGroup
| Overrides the default queue group for the service ("q"). More...
bool | NoQueueGroup
| Disables the use of a queue group for the service. More...
natsMetadata | Metadata
| Immutable metadata for the service, a JSON-encoded user-provided object, e.g. `{"key":"value"}` More...
microEndpointConfig * | Endpoint
| The "main" (aka default) endpoint configuration. More...
microRequestHandler | StatsHandler
| A custom stats handler. More...
microErrorHandler | ErrHandler
| An error notification handler. More...
microDoneHandler | DoneHandler
| A callback handler for handling the final cleanup `Done` event, right before the service is destroyed. More...
void * | State
| A user-provided pointer to state data. More...

## Detailed Description

The service is created with a clone of the config and all of its values, so the original can be freed or modified after calling micro_AddService.

## Member Data Documentation

## ◆ Name

const char* micro_service_config_s::Name

It can be used to compose monitoring messages specific to this service.

## ◆ Version

const char* micro_service_config_s::Version

## ◆ Description

const char* micro_service_config_s::Description

## ◆ QueueGroup

const char* micro_service_config_s::QueueGroup

## ◆ NoQueueGroup

bool micro_service_config_s::NoQueueGroup

## ◆ Metadata

natsMetadata micro_service_config_s::Metadata

## ◆ Endpoint

microEndpointConfig* micro_service_config_s::Endpoint

It is the default in that it does not require calling microService_AddEndpoint, it is added automatically when creating the service.

## ◆ StatsHandler

microRequestHandler micro_service_config_s::StatsHandler

It will be called to output the service's stats. It replaces the default stats handler but can pull the service stats using microService_GetStats function, then marshal them itself, as appropriate.

## ◆ ErrHandler

microErrorHandler micro_service_config_s::ErrHandler

It will be called asynchonously upon internal errors. It does not get called for application-level errors, successfully sent out by the microservice.

## ◆ DoneHandler

microDoneHandler micro_service_config_s::DoneHandler

It will be called directly from microService_Stop method, so it may be executed in any of the user threads or in the async callback thread if the service stops itself on connection closed or an error event.

## ◆ State

void* micro_service_config_s::State

A closure that is accessible from the request, stats, and internal event handlers. Please note that handlers are invoked on separate threads, consider thread-safe mechanisms of accessing the data.

The documentation for this struct was generated from the following file:

- nats.h