Tasks
Publish to RabbitMQ
Publishes a message to a RabbitMQ queue
Basic usage
Parameters
rabbitmq required object
Contains the RabbitMQ connection and message parameters.
rabbitmq.queue_name required string
The name of the RabbitMQ queue to publish the message to.
rabbitmq.message required string
The message content to publish to the queue. This can be a string or stringified JSON object.
rabbitmq.connect_options required object
Contains the connection configuration for RabbitMQ.
rabbitmq.connect_options.connecturl required string
The connection URL to connect to the RabbitMQ server. The format is typically:
amqp://username:password@hostname:port or amqps://username:password@hostname:port for SSL connections.
To ensure that your connection URL remains secret, use credentials. See example here.
Result
Properties
publish_result object
Contains details about the published message.
publish_result.queue_name string
The name of the queue the message was published to.
publish_result.message_size number
The size of the message in bytes.
publish_result.timestamp string
ISO 8601 timestamp of when the message was published.
Examples
Publishing a simple text message
Publish a simple text message to a RabbitMQ queue:
Result
Publishing JSON data
Publish structured JSON data to a RabbitMQ queue:
Result
Publishing dynamic data from stub
Publish data from the current stub to a RabbitMQ queue:
This example uses Inline text substitution to dynamically insert values into the message.
Result
Using Credentials for the connection URL
It is possible to use credentials to ensure that your connection URL remains secret and is not displayed in the task on your template.
Create a new Generic credential and set the credential name to whatever you would like and set the Secret Value to your RabbitMQ connection URL.
After you create the credential, copy the credential UUID.
Structure the publish_to_rabbitmq task as follows:
There is an additional parameter: org_credentials. Within this object, add a value for your Generic Credential UUID.
Set the connecturl value to use targeted substitution on your Generic Credential UUID in org_credentials.