The OUTPUT RABBITMQ operator enables sending a message to the RabbitMQ message broker. The message is created based on data from the operator’s input data bus stream and sent to the specified queue or exchange in the RabbitMQ system. The operator processes each data bus record individually, sending a single message based on the data from that record.
According to its configuration, the RabbitMQ broker delivers messages to connected consumers, including other applications or modules that listen on specific channels. The GRAVITY system can also operate as a message consumer, enabling bidirectional communication and integration with other systems in an event-driven architecture.
Use cases of the OUTPUT RABBITMQ operator:
- integration of GRAVITY processes with systems that use message queues,
- sending messages to distributed applications and services,
- implementing an architecture based on events and asynchronous data exchange,
- delegating task execution to another system.
Example of a GRAVITY project using the OUTPUT RABBITMQ operator:
SELECTING AND CREATING A RABBITMQ CONNECTION
Go to the RabbitMQ connection tab in the operator properties.
If you already have a connection defined, select it from the RabbitMQ Connection dropdown list; the connection fields will be populated according to the selected connection.
You can modify the connection details by clicking the Edit button.
If you do not yet have a RabbitMQ connection defined in the system, you can add one using the Add button.
After entering the details of the new connection, you can test it using the Test connection button and save it in the system by clicking Save.
After saving, the connection will be available in the system under the name specified in the Name field.
MESSAGE CONFIGURATION
In the first step, you must specify how you want to send the message (the Message configuration tab).
Depending on how your message server is configured, you must specify where you want to send the message in the Send message to field:
- Direct to queue → allows you to send the message directly to a selected queue created on the server. In this case, you must also provide the queue name in the Queue name field.
- To exchange → allows you to send the message to a message exchange, which forwards the message to the appropriate queues according to its configuration.
When sending a message to an exchange, you must provide the exchange name in the Exchange name field and optionally a Routing key.
You can also specify how the system should behave if sending a message to the RabbitMQ server fails, for example due to a loss of connection.
In the Action after failed field, choose one of the following options:
- Continue processing → The error information will be visible in the execution logs, but the process will not be interrupted, any transactions will not be rolled back, and no processing error will be reported.
- Abort processing with error → The process will be stopped, transactions will be rolled back, and a processing error will be reported.
The final step is to create the message itself (the Message tab).
The message content can come from two sources (the Message source field):
- From busbar → the message content is available on the data bus in one of its bits (columns). You must indicate the appropriate bit in the Column with message field.
- Text → you can manually compose the message in the Message field using all data bus bits as well as project parameters.