> For the complete documentation index, see [llms.txt](https://docs.aamsystems.ru/passoffice/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aamsystems.ru/passoffice/passoffice-guide/admin-guide-doc/rabbitmq.md).

# RabbitMQ

RabbitMQ — это брокер сообщений (AMQP), используемый для обмена данными между компонентами PassOffice и внешними системами.

**1. Установка RabbitMQ**

**Автоматическая установка (по умолчанию)**

При инсталляции PassOffice RabbitMQ устанавливается автоматически. Если этого не произошло:

**Ручная установка**

1. **Установите зависимости**:
   * **Erlang** (необходим для работы RabbitMQ).
   * **RabbitMQ** (можно взять из папки `Addons` или выбрать в инсталляторе PassOffice).
2. **Запустите RabbitMQ**:
   * После установки служба должна запуститься автоматически.
   * Проверить статус можно в **Службах Windows** (`rabbitmq-server`) или через командную строку:

     ```
     rabbitmqctl status
     ```

**2. Настройка веб-интерфейса (Management Plugin)**

Для доступа к панели управления:

1. Активируйте плагин:

   ```
   rabbitmq-plugins enable rabbitmq_management
   ```
2. Перезапустите RabbitMQ:

```
rabbitmq-service restart  # Windows
systemctl restart rabbitmq-server  # Linux
```

3. Откройте веб-интерфейс:

* Адрес: [http://localhost:15672](http://localhost:15672/)
* Логин/пароль по умолчанию: **`guest` / `guest`**

**3. Безопасность и пользователи**

**Смена пароля по умолчанию**

1. Через командную строку:

   ```
   rabbitmqctl change_password guest "НовыйПароль123"
   ```
2. Через веб-интерфейс:
   * Вкладка **Admin** → **Users** → **guest** → **Set password**.

**Создание нового пользователя**

```
rabbitmqctl add_user admin MySecurePassword
rabbitmqctl set_user_tags admin administrator
```

**4. Интеграция с PassOffice**

RabbitMQ используется для:

* Обработки системных событий.
* Обмена сообщениями между модулями PassOffice.

**Проверка работы очередей**

1. В веб-интерфейсе перейдите в **Queues**.
2. Убедитесь, что очереди PassOffice активны (например, `passoffice.events`).

**5. Дополнительные настройки**

**Конфигурация через файл**

Настройки RabbitMQ хранятся в:

* Windows: `%APPDATA%\RabbitMQ\rabbitmq.conf`
* Linux: `/etc/rabbitmq/rabbitmq.conf`

Пример конфигурации:

```
listeners.tcp.default = 5672
management.tcp.port = 15672
default_user = admin
default_pass = SecurePass123
```

**6. Возможные проблемы**

| Проблема                        | Решение                                                     |
| ------------------------------- | ----------------------------------------------------------- |
| RabbitMQ не запускается         | Проверьте, установлен ли Erlang.                            |
| Ошибка доступа к веб-интерфейсу | Убедитесь, что плагин `rabbitmq_management` включен.        |
| Сообщения не обрабатываются     | Проверьте, что очереди существуют и подключены потребители. |

Для подробной настройки обратитесь к [официальной документации](https://www.rabbitmq.com/documentation.html).


---

# 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 dynamically by asking a question.

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

```
GET https://docs.aamsystems.ru/passoffice/passoffice-guide/admin-guide-doc/rabbitmq.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
