> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/lowcode-do-rabbitmq/konfiguracja.md).

# Configuration

This page describes the configuration that administrators prepare so that scripts can send messages to RabbitMQ queues using the function `api.queue.v1.publishAsync` (page [Lowcode to RabbitMQ](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/lowcode-do-rabbitmq.md)).

To configure it, you need the data that the process designer agreed with the administrators and sent in the ticket ([example ticket](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/lowcode-do-rabbitmq.md#przyklad-zgloszenia)): the connection name, the exchange or target queue, the routing key, and information about which scripts will send messages.

## Configuration example

Set the variables in the `env.yaml` (ConfigMap) of each application in the section [Applications that require configuration](#aplikacje-ktore-wymagaja-konfiguracji). Full example of connection configuration `INTEGRATION`:

```yaml
# RabbitMQ broker data, common to all connections
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_HOST: 'rabbitmq.bank.local'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_PORT: '5671'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_SSL_ENABLED: 'true'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_SSL_VALIDATE_SERVER_CERTIFICATE: 'true'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_SSL_VERIFY_HOSTNAME: 'true'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_VIRTUAL_HOST: 'eximee'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_USERNAME: '<username>'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_PASSWORD: '<password>'

# Connection "integration": default exchange, routing key = queue name
SCRIPT_QUEUE_INTEGRATION_PRODUCER_EXCHANGE: ''
```

The following sections describe where to get the values for this example, which applications to set them in, how to prepare the broker, and then the connections, segment `COMMON` and each variable.

## Data from the ticket

| Data from the ticket                       | What to do with them                                                                                                                                                                                                                                                               |
| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Connection name, for example `integration` | The process designer may suggest a name. Confirm it or indicate an existing connection. Use it in uppercase in variable names, for example `SCRIPT_QUEUE_INTEGRATION_PRODUCER_EXCHANGE`. The name cannot contain the character `_` (section [Connection name](#nazwa-polaczenia)). |
| Exchange                                   | Enter it in `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_EXCHANGE`. For the default exchange, set an empty value `''`.                                                                                                                                                                      |
| Target queue and routing key               | Create the queue on the broker, and for a named exchange also create a binding from the exchange with this routing key. In Eximee configuration you do not enter them: the routing key is provided by the script with each send.                                                   |
| Sending from a service script in a form    | Configure the connection in the application `webforms` (section [Applications that require configuration](#aplikacje-ktore-wymagaja-konfiguracji)).                                                                                                                                |
| Sending from a script task in a process    | Configure the connection in the application `process-handler-executor-camunda`.                                                                                                                                                                                                    |

## Applications that require configuration

The message is sent by the application that executes the script. Add the connection configuration in each application from which scripts are to send messages:

| Application                        | Scripts                             |
| ---------------------------------- | ----------------------------------- |
| `webforms`                         | Service scripts invoked from forms. |
| `process-handler-executor-camunda` | Script tasks in processes.          |

The configuration of one application does not work in another. If the connection `integration` is configured only in `webforms`, the script task that uses it will fail with an error `No queue client found. [connectionId=integration]`.

## Preparing the broker

The platform does not create queues, exchanges, or bindings on the broker. They are prepared by the RabbitMQ administrator.

{% hint style="danger" %}
The application does not check whether the exchange and target queue exist. A message sent to an exchange that does not exist on the broker, or with a routing key for which there is no queue, is lost without an error.
{% endhint %}

## Connections and segment `COMMON`

The configuration consists of named connections. A connection is broker data (address, virtual host, user, TLS) and the exchange to which sent messages go. The script uses the connection name to indicate where to send the message.

`COMMON` is not a connection. It is a set of default values that the application adds to every connection. A connection can override any of them with its own value.

A connection is created only when it has an exchange set (`PRODUCER_EXCHANGE`). A connection without an exchange is not created, and the script that uses it ends with an error `No queue client found`.

### Typical configuration: one broker

In most deployments, all queues are on one broker, in one virtual host. Then:

* set the broker data once, in the variables `SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_*`,
* create one connection, for example `INTEGRATION`, and set only the exchange in it.

Such a configuration is shown by the [configuration example](#przyklad-konfiguracji) at the top of the page.

### Several connections: different broker, virtual host, user, or exchange

Add another connection when some messages need to go to a different broker, a different virtual host, with a different user, or to a different exchange. In the new connection, set its exchange and the data that differ from `COMMON`.

Example: connection `PARTNER` sends to the exchange `partner.events` in the virtual host `partner`. The address, port, TLS, and login data are taken from `COMMON`:

```yaml
SCRIPT_QUEUE_PARTNER_PRODUCER_CLIENT_VIRTUAL_HOST: 'partner'
SCRIPT_QUEUE_PARTNER_PRODUCER_EXCHANGE: 'partner.events'
```

In the script, refer to it by the name `'partner'`.

{% hint style="warning" %}
Do not set `PRODUCER_EXCHANGE` in the segment `COMMON`. The exchange from `COMMON` applies to every connection that has not set its own, so each such connection would send to the same exchange, even on a broker or in a virtual host where it does not exist. Such messages are lost without an error.
{% endhint %}

### Connection name

The connection name is the part of the variable name between `SCRIPT_QUEUE_` and `_PRODUCER`. In the example `SCRIPT_QUEUE_INTEGRATION_PRODUCER_EXCHANGE` the connection is called `INTEGRATION`.

* In the script, use the connection name in lowercase: `'integration'`. A name written in uppercase ends with an error `No queue client found`.
* The connection name is one word, without the character `_`. The application treats the character `_` in the variable name as a separator. From the variable `SCRIPT_QUEUE_BANK_CENTRALNY_PRODUCER_EXCHANGE` no connection will be created `BANK_CENTRALNY`, and the script that calls `'bank_centralny'`, will end with an error `No queue client found`. Use for example `BANKCENTRALNY` and in the script `'bankcentralny'`.
* Name `COMMON` is reserved for default values and does not create a connection.

## Variables

### Connection to the broker

Instead of `<CONNECTION>` enter `COMMON` (value for all connections) or the connection name (value only for that one). The default value applies when the variable is not set either for the connection or in `COMMON`.

| Variable                                                                    | Description                                                                                                                          | Default value                                |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_HOST`                            | Broker address.                                                                                                                      | `localhost`                                  |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_PORT`                            | Broker port.                                                                                                                         | `5671` when TLS is enabled, otherwise `5672` |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_VIRTUAL_HOST`                    | RabbitMQ virtual host.                                                                                                               | `/`                                          |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_USERNAME`                        | Broker user.                                                                                                                         | `guest`                                      |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_PASSWORD`                        | Broker user password.                                                                                                                | `guest`                                      |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_SSL_ENABLED`                     | `true` enables connection encryption (TLS).                                                                                          | `false`                                      |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_SSL_VALIDATE_SERVER_CERTIFICATE` | `true` enables broker certificate verification. Description in the section [Encrypted connection (TLS)](#polaczenie-szyfrowane-tls). | `false`                                      |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_CLIENT_SSL_VERIFY_HOSTNAME`             | `true` enables checking whether the broker certificate was issued for its address.                                                   | `false`                                      |

{% hint style="info" %}
Sending variables have `PRODUCER`in their names. Receiving variables, with `CONSUMER` in their names, are set separately in the application `lowcode-queue-consumer` (page [RabbitMQ consumer configuration](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/konsumenci-rabbitmq/konfiguracja.md)).
{% endhint %}

### Connection exchange

Instead of `<CONNECTION>` enter the connection name. Do not set this variable in `COMMON`.

| Variable                                      | Description                                                                                                                                                         | Default value                                         |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| `SCRIPT_QUEUE_<CONNECTION>_PRODUCER_EXCHANGE` | Exchange to which the connection sends messages. Empty value `''` means the default exchange: the message goes to the queue whose name is equal to the routing key. | None: a connection without an exchange is not created |

{% hint style="warning" %}
The application ignores, without warning, a variable with a typo in its name, for example `SSL_ENABLE` instead of `SSL_ENABLED`. After each configuration change, check the sending operation (section [Checking operation](#sprawdzenie-dzialania)).
{% endhint %}

## Encrypted connection (TLS)

For an encrypted connection with broker certificate verification, set all three variables:

```yaml
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_SSL_ENABLED: 'true'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_SSL_VALIDATE_SERVER_CERTIFICATE: 'true'
SCRIPT_QUEUE_COMMON_PRODUCER_CLIENT_SSL_VERIFY_HOSTNAME: 'true'
```

The broker certificate is then checked using the default Java truststore in the application image. A self-signed certificate or one issued by an internal CA will be rejected if that CA is not in the truststore.

{% hint style="danger" %}
Just `SSL_ENABLED: 'true'` encrypts the connection, but does not verify the broker certificate: the application will accept any certificate. In production environments, always set also `SSL_VALIDATE_SERVER_CERTIFICATE` and `SSL_VERIFY_HOSTNAME`.
{% endhint %}

## Deploying configuration changes

The application creates connections at startup. After changing `env.yaml`, for example after adding a connection, restart the application.

The application does not connect to the broker at startup, only on the first send. So it will also start when the broker is unavailable or the connection data is wrong, and the error will appear only in the script that sends the message.

## Checking operation

1. Run the script that sends a message, for example the sample service script from the page [Lowcode to RabbitMQ](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/lowcode-do-rabbitmq.md#przykladowy-skrypt-uslugowy).
2. If the script ended with an error, compare the message with the table in the section [Troubleshooting](#rozwiazywanie-problemow).
3. In the RabbitMQ Management panel, open the target queue, expand the **Get messages** section, and fetch the message. Check its content and headers.

The application does not write information about sent messages to the logs at the `INFO` level. Sending entries are added by the script itself through the `Logger`object, as in the sample service script.

## Troubleshooting

| Symptom                                                                                                  | Possible cause                                                                                                                                                                                                                                                              | Solution                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| The script ends with an error `No queue client found. [connectionId=<name>]`                             | The connection is not configured in the application that executes the script, there is no `PRODUCER_EXCHANGE` set, or its name contains the character `_`.                                                                                                                  | Add a connection from `PRODUCER_EXCHANGE` in this application and restart it.                                                            |
| The script ends with an error `AmqpConnectException`, `AmqpAuthenticationException` or `AmqpIOException` | The application connects to the broker on the first send. `AmqpConnectException`: the broker is unavailable or the address or port is incorrect. `AmqpAuthenticationException`: invalid login credentials. `AmqpIOException`: for example, the virtual host does not exist. | Check the `PRODUCER_CLIENT_*` variables and the broker's availability from the application. For port `5671` check whether `SSL_ENABLED`. |
| The script ends without an error, and there is no message in the queue                                   | The exchange from `PRODUCER_EXCHANGE` does not exist on the broker, the exchange binding with the queue is missing, or the routing key does not match any queue.                                                                                                            | Check the exchange, bindings, and routing key on the broker.                                                                             |

## Related pages

* [Lowcode to RabbitMQ](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/lowcode-do-rabbitmq.md) — sending messages from scripts and script tasks.
* [RabbitMQ consumer configuration](https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/konsumenci-rabbitmq/konfiguracja.md) — receiving message configuration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eximee.com/documentation/documentation-en/eksploatacja-aplikacji/obsluga-zdarzen/lowcode-do-rabbitmq/konfiguracja.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
