Getting started
To be able to send messages to Data Publisher, a module needs to register itself first. This is supposed to happen through the provided REST API during the module startup phase (see how to register in Data Publisher for details). The information provided by the modules with the registration is used to offer the input for the flows that process messages in Data Publisher (see also Processing chain concept).
The module registration is tenant independent. |
Base information
Each module has to provide the following information during registration:
-
Module name (unique across all modules)
-
Module id (Multitenant Access Control public client id)
-
A list of data types the module is able to send to Data Publisher
Data types
For each data type the module has to provide the following information:
-
Data type name (must be unique for each version across all modules)
-
Data type version (only semantic versioning is supported)
-
RabbitMQ exchange name to which the module sends messages of this data type (it can contain the placeholder
{tenantId}
for the tenant id) -
(optional) RabbitMQ vhost name, if different from the standard one (/)
-
(optional) JSON schema of the data type which can be used to validate the messages (if enabled in the processing chain definition)
-
(optional) Dictionary with localized names of the data type to be displayed in the UI
Notifications
During registration, the module can enable the notification upon (de-)activation of chains that process one its data type.
-
When the first chain that processes a data type is activated, an activation message can be sent to the module for that data type.
-
When the last chain that processes a data type is deactivated, a deactivation message can be sent to the module for that data type.
In this way, the module can start or stop sending messages of a specific type accordingly, avoiding to congest the internal RabbitMQ message broker with messages that will not be processed. For this configuration, the module can provide the following input:
-
Notification mode: None (default), Sync (synchronous), Async (asynchronous)
-
Url of the API exposed by the module to receive the messages for (de-)activation. Required only if the mode is set to "Sync".
-
RabbitMQ exchange name used by the module to receive the message for (de-)activation. Required only if the mode is set to "Async".
The asynchronous notification mode is not available yet. |
For receiving synchronous notifications, the module has to expose a REST API with a PUT method accepting following content:
{
"name": "myDataType", // data type name (unique with version)
"version": "1.0.0" // data type version
"activate": true // true if the module can start sending messages of the specified type, false if otherwise
}