Instant messaging processor (im)
Description
Processor for exchanging instant messages with messengers.
Provides communication with messengers. Places subscriber messages received from messengers into the data model collection `/rest/v1/model/im/Messages`, and sends messages created there with `sending` status to messenger subscribers.
Creates collections/classes: im/Accounts, im/RemoteParties, im/Messages. Allows their further modification to extend the set of properties and the value variants of enumerated fields.
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Capabilities
-
Messages can be text, images, audio files, etc. Message text is placed in the `/im/Message` entity field, while other variants are stored as attachments (file field) and are available via `/rest/v1/model/im/Messages/ID_MESSAGE/file`.
-
Supports adding adapters for different messenger types by creating plugins (Erlang) or implementing strategies in scripts.
Limitations
-
Each individual messenger requires unique parameters that can be set in account options (the `options` field of the im/Accounts entity). In particular, for Telegram, `token` must be specified there, and optionally `disable_notification` (`true` | `false`) and `parse_mode` (`none`, `markDown`, `HTML`).
-
The platform includes a Telegram connector. Other connectors require project development and can be implemented as scripts (separately a script for receiving messages and placing them in collections, and separately a script for sending one specific message).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
required |
Name. May consist of Latin letters and digits and must start with a letter. |
|
|
required |
Role type. Possible values: |
|
|
empty |
Additional role options. Contains a JSON object or list. |
|
|
empty |
Role activity flag. When set to false, the role does not participate in validation and is not started. |
|
|
empty |
Limit on the number of CPU logical cores used. Default: 0 - unlimited. |
|
|
empty |
Default logging level set specifically for the role instance (microservice type). More |
|
|
|
Flag allowing parameter differences in roles of the same group. Default: false - not allowed. |
|
|
required |
Group number. |
|
|
required |
Order of the role instance within the group. |
|
|
empty |
List of domain names served by this group. |
|
|
global |
Takeover mode switch.
|
|
|
Domain distribution group number. Instances with the same value share the domain subtree ( |
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.
{
"name": "im1",
"roletype": "im",
"group": 11330,
"order": 1
}