RabbitMQ

Discover more about the RabbitMQ component and how to use it on the Digibee Integration Platform.

RabbitMQ allows messages to be published in a RabbitMQ broker.

Parameters

Take a look at the configuration parameters of the component. Parameters supported by Double Braces expressions are marked with (DB).

ParameterDescriptionDefaultvalueData type

Account

Credential used to authenticate in RabbitMQ. Supported accounts: Basic.

N/A

String

Hostname

Name of the host that executes the RabbitMQ.

N/A

String

Port

Connection port of the RabbitMQ.

5672

Integer

Connection Timeout

Maximum time to connect to RabbitMQ.

60000

Integer

Virtual Host

Name of the logical group inside RabbitMQ to which there must be a connection.

/

String

Exchange Name (DB)

Name of the exchange defined in RabbitMQ to which there are messages sent to.

N/A

String

Binary Message

If the option is activated, the message will be considered binary, and the Message Body field must inform a string containing the base64 representation of the bytes set to be sent; otherwise, the message will be considered as text.

False

Boolean

Message Body (DB)

Content of the message to be sent.

N/A

String

Routing Key

String representing the relationship key between the Exchange and the Queue(s).

N/A

String

Headers

Set of key-value inputs containing headers that are sent in the message (optional field).

N/A

Key-value

Message Type

String representing the type of message (optional field).

N/A

String

Message Content Type

String representing the content type of the message (e.g., application/json) (optional field).

N/A

String

Message Content Encoding

String representing the content coding (e.g., UTF-8) (optional field).

N/A

String

Priority

Number indicating the priority of the message (optional field).

N/A

Integer

Correlation ID

String representing the correlation ID of the message (optional field).

N/A

String

Message ID

String representing the ID of the message (optional field).

N/A

String

Delivery Mode

If "Persistent Message", then the message is sent with the persistent flag, and the broker will try to keep it in disk as soon as possible; if "Transient Message", then the broker will try to keep the message in memory.

Persistent Message

String

Reply To

String representing the message return address (optional field).

N/A

String

Message Expiration

Number representing the duration time of the message in the queue (also known as TTL) (optional field).

N/A

Integer

Message Timestamp

Number representing the message timestamp (optional field).

N/A

Integer

Application Name

String representing the application name (optional field).

N/A

String

Fail On Error

If the option is enabled, the execution of the pipeline with error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property.

False

Boolean

Wait for a Publish Acknowledgement

If the option is activated, the component will wait for a message publication confirmation; otherwise, the component will send the message and won't wait for a confirmation.

False

Boolean

Publisher Acknowledgement Timeout

Maximum time the component will wait for a message publication confirmation.

5000

Integer

Mandatory Message

If the option is activated, the message is marked as mandatory, and an error will be thrown if it can't be routed; otherwise, no routing verification is made (the Wait for a Publish Acknowledgement option needs to be enabled).

False

Boolean

Important: the configuration parameters won't be defined in the message if their values are left in blank.

Example of request answer to RabbitMQ

<SAME MESSAGE INFORMED IN THE INPUT>

Important: RabbitMQ doesn't change the message presented in its input, except in case of error.

Example of request answer to RabbitMQ with error

{
"success": false,
"message": "Could not publish message to RabbitMQ due to an error",
"error": "java.net.SocketTimeoutException: connect timed out"
}
  • success: “false” when the operation fails

  • message: message about the error

  • exception: information about the type of occurred

Messages flow

Input

The component accepts any input message, being able to use it through Double Braces.

Output

  • without error

<SAME MESSAGE INFORMED IN THE INPUT>
  • with error

{
"success": false,
"message": "Could not publish message to RabbitMQ due to an error",
"error": "java.net.SocketTimeoutException: connect timed out"
}

RabbitMQ in Action

A message is always sent through this component from Exchange Name and Routing Key. The exchange has a bind with a topic or queue and forwards the message from the routing key.

Sending a simple message

Input message:

{
"message": "test"
}

Configurations:

  • Hostname: <RABBITMQ HOSTNAME>

  • Port: <PORT> (pattern port: 5672)

  • Virtual Host: /

  • Exchange Name: <EXCHANGE NAME>

  • Binary Message: disabled

  • Message: {{ message.$ }}

  • Routing Key: <ROUTING KEY>

  • Fail On Error: disabled

Result:

{
"message": "test"
}

Sending a simple binary message

Input message:

{
"message": "ewoJIm1lc3NhZ2UiOiAidGVzdCIKfQo="
}

Configurations:

  • Hostname: <RABBITMQ HOSTNAME>

  • Port: <PORT> (pattern port: 5672)

  • Virtual Host: /

  • Exchange Name: <EXCHANGE NAME>

  • Binary Message: enabled

  • Message: {{ message.message }}

  • Routing Key: <ROUTING KEY>

  • Fail On Error: disabled

Result:

{
"message": "ewoJIm1lc3NhZ2UiOiAidGVzdCIKfQo="
}

Sending a message to a queue and the response will be returned to another specificated one (Direct Reply-To)

Input message:

{
"message": "test"
}

Configurations:

  • Hostname: <RABBITMQ HOSTNAME>

  • Port: <PORT> (pattern port: 5672)

  • Virtual Host: /

  • Exchange Name: <EXCHANGE NAME>

  • Binary Message: disabled

  • Message: {{ message.$ }}

  • Routing Key: <ROUTING KEY>

  • Reply To: <REPLY TO>

  • Fail On Error: disabled

Result:

{
"message": "test"
}

Last updated