RabbitMQ Acknowledge#
This task sends an acknowledgement to the RabbitMQ broker for a specific message that has been processed. This informs RabbitMQ that the message has been successfully handled and can be removed from the queue. This task should be used with the RabbitMQ Subscribe from Exchange or RabbitMQ Subscribe from Queue task.
Inputs#
| Name | Data Type | Description |
|---|---|---|
| Activate | any | Triggers the task to send the acknowledgement. |
Outputs#
| Name | Data Type | Values | Description |
|---|---|---|---|
| Success | Boolean | Emits true when the acknowledgement is sent successfully. | |
| Error | Error | Emits an Error object if the acknowledgement fails. |
Settings#
This task does not have any specific settings on a dedicated "Settings" tab beyond the usual task settings. The necessary information for acknowledging a message (the message itself) is expected to be available within the execution context of the workflow.
Behavior#
The RabbitMQ Subscribe from Exchange or RabbitMQ Subscribe from Queue task creates a subscription for a particular queue or exchange and creates an execution context to handle the messages received. If the message received is waiting for an acknowledge it will expect to receive an execution context from any of the Subscription tasks in the allotted time of the ReplyTimeout.
When the Activate input is triggered, this task retrieves information about the currently processed RabbitMQ message from the workflow's execution context. This information typically includes the raw message object, which contains the necessary delivery tag or identifier for RabbitMQ to acknowledge the specific message.
If the acknowledgement is sent successfully, the success output emits true. If any error occurs during the acknowledgement process (e.g., connection issues with RabbitMQ, invalid message information), the error output will emit an Error object containing details about the failure.
Remarks#
- This task provides a crucial mechanism for ensuring reliable message processing with RabbitMQ. By explicitly acknowledging successfully processed messages, you prevent data loss and manage the message lifecycle within your RabbitMQ queues.
- Ensure that a RabbitMQ connection is properly configured and the
GlobalRabbitMQManagerHandlerdependency is correctly set up within your controller for this task to function. - Failure to acknowledge messages in RabbitMQ can lead to messages being redelivered, potentially causing duplicate processing.
