# RabbitMQReader

The **RabbitMQReader** fetches messages from a specified Queue on a RabbitMQ server.

***

## Properties

### Return raw bytes

If selected, the contents of the message's body will be returned as a list of bytes.

**Content type**:

The type of data that the body contains.

**Character encoding**:

The character encoding that must be used to decode the body to a string.

Only displayed when Content type is 'String' or 'List'.\_

***

### Queue name

The name of the queue on the RabbitMQ server from which to fetch the messages.

### Return option

How to return the messages.

1. **Next message**\
   Retrieves the next message in the queue. An exception will be thrown if the queue is empty.
2. **Next message, else empty**\
   Retrieves the next message in the queue or leaves all message-fields blank if the queue is empty.
3. **List of messages**\
   Returns the messages from the queue in a list.
4. **Loop messages**\
   Returns the messages from the queue one at a time in a loop.

### Timeout

Only displayed if the [Return option](#return-option) is set to 'Next message' or 'Next message, else empty'.

If the queue is empty, the function will keep looking in the queue for new messages until the specified number of milliseconds run out.

### Message count limit

Only displayed if the [Return option](#return-option) is set to 'List of messages' or 'Loop messages'.

Specifies the maximum number of messages that will be fetched from the queue. Use 0 for no limit.

### Headers

The list of expected headers. Each entry will create a corresponding property in the function's result set to store the header's value. Any headers of the message that are not specified will be included in the *AdditionalHeaders* list property of the results.

### Connection uri

Server details.

Click the **...** icon to open the **Connection Editor**.

**Host**:

The IP address or domain name of the server to connect to.

**Port**:

The port number to connect to. RabbitMQ server runs on port 5672 by default.

**Username**:

The username to use for authentication.

**Password**:

The password to use for authentication.

**Virtual host**:

The virtual host to access on the RabbitMQ server.

**Use SSL**:

Select if SSL must be used when connecting.

***

## Definition

### DeliveryTag

A unique identifier for a message, assigned by the server and specific to the channel on which the message was received.

### ExchangeName

The name of the Exchange the message was published to.

### RoutingKey

The routing key that the Exchange used to determine to which Queue(s) the message was to be sent.

### CorrelationID

This field is used when a response message was expected. The response message can be identified by the CorrelationID.

### ReplyTo

This field is used when a response message was expected. It specifies the name of the Queue where the response was to be sent.

### Body

Content of the message.

### Priority

The priority of the message, which can be in the range 0-9 (inclusive), where 0 is the default and the highest priority level, and 9 is the lowest priority level.

### Additional Headers

The *Name* and associated *Value* for any additional headers that were sent with the message.

***

## Links

[RabbitMQ web site](http://www.rabbitmq.com)

[AMQP Model](https://www.rabbitmq.com/tutorials/amqp-concepts.html)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linx.software/reference/plugins/rabbitmq/content/rabbitmqreader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
