# Technical Integration

Welcome! This guide explains how to integrate with LSports Engage Hyper LiveScore Feed and its complementary Fixtures Feed.

***

## Access Credentials (Required for All Components)

Obtain the following from your Customer Success Manager (CSM):

* **Username**
* **Password**
* **CustomerPackageId**

These credentials are used for:

* Both RabbitMQ vhosts: `Fixtures` and `Incidents`
* All Customers API endpoints (Activate, Snapshot, Status, etc.)

The same credentials apply to both vhosts and the Customers API.

***

## Critical: Steps 1 & 2 Must Be Performed Immediately

After receiving credentials, you must:

1. Establish your RabbitMQ consumers
2. Activate your package

These steps should be completed back-to-back.

{% hint style="warning" %}
If a queue accumulates **50,000 unprocessed messages**, it will automatically deactivate. High-volume sports can reach this limit very quickly.

If deactivation occurs:

* Use the **Get Package Status** endpoint to verify the queue state
* Reactivate the queue using the **Activate Package** endpoint (Customers API)

Failure to consume messages in time will result in interruption of delivery until the package is reactivated.
{% endhint %}

***

## Step 2 — Establish RabbitMQ Connections

**Host:** `hyper-livescore.lsports.eu` **Port:** `5671` **Protocol:** AMQP 0-9-1 over TLS **Encoding:** UTF-8 JSON

Open two separate AMQP connections (one per vhost):

* `Fixtures`
* `Incidents`

**Queue name (both vhosts):**

```
_{CustomerPackageId}_
```

{% hint style="info" %}
Do not begin consuming until the package is activated (next step).
{% endhint %}

***

## Step 3 — Activate Your Package

Call the **Activate Package** endpoint via the Customers API.

This action:

* Provisions your queues
* Makes them available for consumption
* Enables message publishing to your vhosts

If your queue was deactivated due to 50,000 unprocessed messages:

1. Call **Get Package Status**
2. Then call **Activate Package** again

➡️ [Customers API Guide](https://docs.lsports.eu/u/engage/hyper-livescore/customers-api-guide)

***

## Step 4 — Start Your Consumers

Once activated, start consuming from both:

* Fixtures queue
* Incidents queue

You should now begin receiving live messages.

***

## Step 5 — Validate Message Flow

Before going live, confirm you are receiving:

* Fixture messages
* All expected Incident kinds

Refer to: [Incident Kinds Types](https://docs.lsports.eu/u/engage/hyper-livescore/incident-kinds-types)

Ensure your system properly handles: Score, Period, FixtureStatus, VAR lifecycle, StatusDescription, and others.

***

## Step 6 — Trigger Initial Fixtures Snapshot (One-Time Only)

Call the **Trigger Snapshot** endpoint via the Customers API.

{% hint style="info" %}
Fixtures are delta-based only — you will only receive updates when something changes. The snapshot ensures your local store is fully seeded with all upcoming fixtures so incidents can be properly correlated. This is required only during initial setup.
{% endhint %}

***

## Step 7 — Store Fixtures Locally

Persist fixture messages locally using `body.fixtureId`.

Your fixture store is mandatory for:

* Incident correlation
* Display logic
* State tracking

***

## Step 8 — Correlate Incidents

For every incoming Incident message, join it with your stored fixture using `body.fixtureId`.

Once correlation works properly — your integration is fully operational.

***

## Operational Best Practices

* Always keep consumers running
* Monitor queue depth continuously
* Never allow queues to approach 50,000 pending messages
* Implement auto-recovery logic

***

## You're Live

If you need support during onboarding or production rollout, contact your Customer Success Manager.
