NATS C Client with JetStream and Streaming support
3.9.1
The nats.io C Client, Supported by Synadia Communications Inc.
|
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... | |
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.
const char* micro_service_config_s::Name |
It can be used to compose monitoring messages specific to this service.
const char* micro_service_config_s::Version |
const char* micro_service_config_s::Description |
const char* micro_service_config_s::QueueGroup |
bool micro_service_config_s::NoQueueGroup |
natsMetadata micro_service_config_s::Metadata |
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.
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.
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.
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.
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.