Search

Home

Home

Creating a RabbitMQ-Type Trigger

Creating a RabbitMQ-Type Trigger

If you want to configure an application invocation triggered by receiving a message from the RabbitMQ broker, you need to select the TRIGGERS option from the main menu.

By selecting New…, you can add a new configuration for automatically starting the GRAVITY application.

image

After choosing the New… option, you need to select the type of automatic invocation from the list.

image

If you decide to use the message-broker notification mechanism, select RABBITMQ from the list.

In the PROPERTIES area, you also need to indicate the GRAVITY application (project) that will from now on be associated with the configured invocation.

image

A trigger of this type passes the message received from the RabbitMQ server to the project parameter that it invokes. For this reason, at least one parameter needs to be defined in the project.

To complete the configuration, you need to provide the data required for this trigger type.

image
  • RabbitMQ connection → the connection to the RabbitMQ server from which you will receive messages
  • Queue name → the name of the queue from which you will receive messages
  • Auto acknowledgement → whether to send information to the server confirming or rejecting a message
    • false → does not send any message to the server, and the server assumes correct processing by default
    • true → sends information to the server about successful or failed message processing depending on the result of the process executed as part of this trigger
    • ❗
      The GRAVITY system sends failed-processing information back to the server with the parameter requeue=false, which means that the message does not return to the queue on the server (otherwise, it would be sent by the server and received by the GRAVITY system in an endless loop, consuming resources), and the message is lost.

      To prevent this, we encourage you to review the server configuration using the DLX and TTL strategies.

      DLX: https://www.rabbitmq.com/dlx.html

      TTL: https://www.rabbitmq.com/ttl.html

  • Message to parameter → the process parameter to which the received message will be passed.

To make the trigger active, you need to set the Enabled switch to on.

image

If you want the system to send an email to specified recipients when a process error occurs, you need to enable the Send mail when error option.

If the project uses parameters, they will be displayed in the Parameters panel as a name–value list. By clicking a value, you can enter a default value for the trigger parameter.

image

The default value will be used if the trigger does not receive a value for this parameter from the invocation (for example, REST API, database, RabbitMQ, etc.) and will be passed to the executed project.