Configuration
Configuration files are provided with channel microservices. If consists of two files:
configuration.yml
This is a standard configuration file for native microservices, where some of the parameters have been adjusted to characteristic of their functions in the environment and should be always considered in the process of system design:
- amount of memory (HEAP)
- number of threads
channels.yml
This file contains channels definitions and their parameters.
Section 'CHANNELS'
Each entry in this section is a definition of a channel. The name of the entry is the name of a channel that should be used during channel communication. Each channel has the following set of parameters:
The appropriate part of the configuration file:
garbageThreadAmount: 1
channelIdleTimeOutInMilliseconds: 1440000 #DAY
elementTimeOutInMilliseconds: 30000
waitTimeBetweenCheckingChannelsInMilliseconds: 5000
channelCloseDelayOnCaseWhenAnyElementExistsInMilliseconds: 8000
storageClassName: 'com.jlupin.impl.microservice.partofjlupin.asynchronous.storage.channel.impl.memory.JLupinMemoryChannelStorageImpl'
Description:
Parameter | Description |
---|---|
garbageThreadAmount |
The number of threads assigned to channel garbage collection process (cleaning channels). |
channelIdleTimeOutInMilliseconds |
The maximum time (expressed in milliseconds) that the channel is opened for publication, if no requests are sent (timeout). After this time the garbage collector closes the channel. |
elementTimeOutInMilliseconds |
The maximum time (expressed in milliseconds) that a message is kept by a channel until it's sent to the subscriber. After this time the garbage collector discard the message. |
waitTimeBetweenCheckingChannelsInMilliseconds |
The time period (expressed in milliseconds) at which the garbage collector check and clean a channel. |
channelCloseDelayOnCaseWhenAnyElementExistsInMilliseconds |
The delay (expressed in milliseconds) of closing channel, if any requests are processed within the channel. |
storageClassName |
The implementation class of storage, where messages are located (default is in-memory) |
Example configuration (channels.yml)
CHANNELS:
SAMPLE:
garbageThreadAmount: 1
channelIdleTimeOutInMilliseconds: 1440000 #DAY
elementTimeOutInMilliseconds: 30000
waitTimeBetweenCheckingChannelsInMilliseconds: 5000
channelCloseDelayOnCaseWhenAnyElementExistsInMilliseconds: 8000
storageClassName: 'com.jlupin.impl.microservice.partofjlupin.asynchronous.storage.channel.impl.memory.JLupinMemoryChannelStorageImpl'