Broker of messages (broker)

Description

System message broker.
Receives and stores data without violating arrival order.

Guarantees delivery of received messages to consumers. When a consumer takes a message, the message is automatically deleted (unlike well-known brokers that retain messages for some time). +

Temporarily and limitedly stores event data in various processes generated on the current site.
Used as a task queue for post-processing processes (CDR aggregator, mixer, packager, transcriber, etc.).

Made redundant in Active-Passive mode.
Scaled by splitting into groups by domains. Potentially, if performance is insufficient, it can be split into groups by queue names. Fundamental rule: one queue - one group.

Table 1. System characteristics

Code

broker

Operation mode

Service, storage

Redundancy mode

Active-Passive

Site types

Any

Layer

Business logic

Placement

Internal

State preservation and recovery on restart

Yes

Application

era_broker

Own storage

ODB Mnesia

Limitations

  • Maximum number of elements in one queue is 2 million. After reaching the limit, the oldest messages begin to be deleted automatically.

  • Maximum message broker throughput for receiving and delivering is about 40 thousand messages per second.

Parameters

Table 2. Parameters
Name Type Default Description

name

str

required

Name. May consist of Latin letters and digits and must start with a letter.

roletype

str

required

Role type. Possible values: "broker".

ext

json

empty

Additional role options. Contains a JSON object or list.

enabled

bool

empty

Role activity flag. When set to false, the role does not participate in validation and is not started.

limit_of_cores

int

empty

Limit on the number of CPU logical cores used. Default: 0 - unlimited.

logging_default_level

int

empty

Default logging level set specifically for the role instance (microservice type). More

allow_divergence

bool

false

Flag allowing parameter differences in roles of the same group. Default: false - not allowed.

group

int

required

Group number.
As part of horizontal scaling, the role can be split into several groups on a site, in each of which only one instance is active and the rest are standby.
Responsibility is divided between groups by queue types (or event classes).
An integer from 1 to 9999999.

order

int

required

Order of the role instance within the group.
Determines the order in which takeover occurs in Active-Passive mode.

mnesia_storage_mode

str

disc

Object storage operation mode.
Possible values:

  • disc - full mode, in RAM with disk persistence on all group instances.

  • ram - RAM only (with distributed and transactional support). If all group instances restart or shut down simultaneously, data is lost.

  • disc_only - disk only (noticeably less performant but saves RAM).

takeover

bool

global

Takeover mode switch.

Failover - activation of a lower-priority service instance when the higher-priority service instance (leader of the active-passive group) is detected as unavailable.
Takeover - activation of the higher-priority service instance (leader of the active-passive group) during its recovery, accompanied by stopping the service on the lower-priority service instance.

  • If the mode is enabled, takeover is performed automatically.

  • If the mode is disabled, takeover is not performed; the recovered group leader temporarily becomes a follower and waits for the service to be unloaded on the lower-priority instance.

  • If the option is not set, its value from the current site parameters is used. If it is not set on the site, the value from the general section is used. If it is not set anywhere, takeover is enabled for more accurate load distribution according to the configured priorities.

include_domains

array<str>

empty

List of domain names served by this group.
Any domain of any level can be specified. Specifying a domain causes its subtree to be served on this group and not on other role groups, except for branches mentioned in other groups.
Together, all role groups on the site serve the full domain tree.

domain_group

int

group

Domain distribution group number. Instances with the same value share the domain subtree (include_domains) as one group. Defaults to the group number.
An integer from 0.

Configuration example

Configuration management is performed in an application available to master domain administrators. The application hides the full configuration content, but it is still available through the API.

The configuration contains a section describing all instances of all roles. Parameters are defined for each specific role instance.

Node example
{
  "name": "broker1",
  "roletype": "broker",

  "group": 11400,
  "order": 1
}

See also