Interface ServiceSetting<CustomSettings>

Service setting interface Merge in the object the service registry settings and the custom settings.

interface ServiceSetting<
    CustomSettings extends
        Record<string, CustomSetting> = Record<string, CustomSetting>,
> {
    adapterOptions?: ConsumerAdapterOptions;
    configLoaderOptions?: Partial<Setup.Config<Record<string, any>>>;
    consumerOptions?: Partial<Omit<ConsumerOptions, "logger" | "registry">>;
    custom: CustomSettings;
    loggerOptions?: Partial<LoggerConfig>;
    metadata?: Partial<Metadata>;
    observabilityOptions?: Partial<ObservabilityServiceOptions>;
    retryOptions?: Partial<
        Omit<RetryOptions, "logger" | "interrupt" | "abortSignal">,
    >;
}

Type Parameters

Hierarchy (View Summary)

Properties

adapterOptions?: ConsumerAdapterOptions

Consumer adapter options: Redis or SocketIO. In order to configure the consumer instance, consumer and adapter options must be provided, in other case the consumer will start with a Dummy adapter with no connection to any external service, so only HTTP commands over the observability endpoints will be processed.

configLoaderOptions?: Partial<Setup.Config<Record<string, any>>>

Configuration loader options. These options is used to load the configuration information of the application that is been wrapped by the Application Wrapper. This configuration could be loaded from files or environment variables, or even both.

To understand the configuration loader options, check the documentation of the package @mdf.js/service-setup-provider.

Use different files for Application Wrapper configuration and for your own services to avoid conflicts.

consumerOptions?: Partial<Omit<ConsumerOptions, "logger" | "registry">>

OpenC2 Consumer configuration options. This configuration is used to setup the OpenC2 consumer, that is used to receive and process OpenC2 commands. The consumer option in the BootstrapOptions should be enabled to start the consumer.

Custom settings

loggerOptions?: Partial<LoggerConfig>

Logger Options. If provided, a logger instance from the @mdf.js/logger package will be created and used by the application in all the internal services of the Application Wrapper. At the same time, the logger is exposed to the application to be used in the application services. If this options is not provided, a Debug logger will be used internally, but it will not be exposed to the application.

metadata?: Partial<Metadata>

Metadata information of the application or microservice. This information is used to identify the application in the logs, metrics, and traces... and is shown in the service observability endpoints.

observabilityOptions?: Partial<ObservabilityServiceOptions>

Observability instance options

retryOptions?: Partial<
    Omit<RetryOptions, "logger" | "interrupt" | "abortSignal">,
>

Retry options. If provided, the application will use this options to retry to start the services/resources registered in the Application Wrapped instance. If this options is not provided, the application will not retry to start the services/resources.