Search

Home

Home

OUTPUT RABBITMQ

OUTPUT RABBITMQ

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:

image

SELECTING AND CREATING A RABBITMQ CONNECTION

Go to the RabbitMQ connection tab in the operator properties.

image

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.

image

You can modify the connection details by clicking the Edit button.

icon
Keep in mind that if the connection is already used by another operator, that operator will also use the modified connection.

If you do not yet have a RabbitMQ connection defined in the system, you can add one using the Add button.

image

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.

image

After saving, the connection will be available in the system under the name specified in the Name field.

icon
For more information on creating a RabbitMQ server connection, see Creatng a New RabbitMQ Connection.

MESSAGE CONFIGURATION

In the first step, you must specify how you want to send the message (the Message configuration tab).

image

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.

    icon
    Routing key is optional, but required for direct or topic exchanges.
icon
The GRAVITY system does not create queues or exchanges on the server. For this reason, any queues or exchanges used must already exist and be configured on the RabbitMQ server.

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).

image

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.
icon
Keep in mind that during project processing, as many messages will be sent to the RabbitMQ server as there are records on the input data bus of the OUTPUT RABBITMQ operator. If you want to build a single message or several messages (grouped by data bus fields) based on the data bus, use the CONVERT BITS TO FORMATCONVERT BITS TO FORMAT operator. This operator allows you to restructure the data bus and create any message you need.