> For the complete documentation index, see [llms.txt](https://docs.lsports.eu/u/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lsports.eu/u/trade/integration/rmq-connection.md).

# RabbitMQ Connection

Establish and maintain a connection to the TRADE data feed

This section covers everything you need to establish and maintain a connection to the TRADE data feed via RabbitMQ.

## Overview

TRADE uses RabbitMQ to deliver real-time sports data. The connection process involves:

1. **Enabling your distribution** - Activating your data package
2. **Establishing connection** - Connecting to the RabbitMQ server
3. **Consuming messages** - Processing incoming data messages
4. **Handling message types** - Understanding and processing different message formats

## Topics in This Section

* [Connection & Consumption Setup](/u/trade/integration/rmq-connection/connection-and-consumption-setup.md) - Step-by-step guide to connect to RabbitMQ
* [Message Deserializing](/u/trade/integration/rmq-connection/message-deserializing.md) - How to decode and parse incoming messages
* [Market/Bet Message Handling](/u/trade/integration/rmq-connection/market-bet-message-handling.md) - Processing market and bet data
* [Working with TRADE Feed](/u/trade/integration/rmq-connection/how-to-work-with-trade-feed.md) - Best practices for feed consumption

## Header-Based Routing

RabbitMQ messages include metadata headers you can read **before** deserializing the payload: `MessageType` on every message, `FixtureId` and `SportId` on data messages, and `MarketId` on market-related messages. Use them to route or filter at the consumer level without touching the message body. See [RabbitMQ Header](/u/trade/integration/message-structure/rabbitmq-header.md) for the full list.

## Connection Details

Connect using the username and password provided by your CSM. The host and virtual host depend on the feed type:

| Parameter        | InPlay                  | PreMatch                  |
| ---------------- | ----------------------- | ------------------------- |
| **Host**         | `stm-inplay.lsports.eu` | `stm-prematch.lsports.eu` |
| **Virtual Host** | `StmInPlay`             | `StmPreMatch`             |

| Parameter    | Value                                 |
| ------------ | ------------------------------------- |
| **Port**     | `5672`                                |
| **Queue**    | `_YOUR_PACKAGE_ID_` (e.g. `_102030_`) |
| **Protocol** | AMQP 0.9.1                            |

Admins can view their RMQ credentials directly in TRADE — go to the avatar menu → **Account** → **Plan & Usage** → **More** (on your TRADE package) → **Integration**. If you need assistance, contact your CSM.


---

# 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.lsports.eu/u/trade/integration/rmq-connection.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.
