LogoLogo
FeedsIntelligenceEngagementsHelpHome
TRADE360 Integration
TRADE360 Integration
  • Integration Guide
  • RMQ connection
    • Connection and Consumption setup
    • Message Deserializing
    • Market/Bet Message Handling
    • How do I work with TRADE360 feed?
  • Message Structure
    • Message Types Overview
    • Message
    • Events
    • Fixture
    • Competition
    • Markets
    • Bets
    • Participant
    • Livescore
    • Settlements
    • Heartbeat
    • Keep Alive
    • Extra Data
    • Outright Fixture
    • Outright Fixture Market
    • Outright League Fixture
    • Outright League Market
    • Outright Settlements
    • Outright League Settlement
    • Example Messages
    • ProviderMarkets
  • APIs
    • Metadata
    • Subscription
    • Distribution
    • Snapshot
    • Notes and Troubleshooting
  • Enumerations
    • Fixture/Scoreboard Status
    • Subscription
    • Message Types
    • Bet Suspension Reasons
    • Fixture Extra Data
    • Status Description
    • Statistics and Incidents
    • Periods
    • Bet Settlements and Statuses
    • Livescore Extra Data
    • Languages
  • SDK
    • SDK Overview
    • Configuration
    • SDK Installation Guide NodeJS
    • SDK Installation Guide .NET
    • SDK Installation Guide Java
  • Code Samples
    • RMQ Consumer (PHP)
    • RMQ Consumer (GO)
    • RMQ Consumer (Node.js)
    • RMQ Consumer (Python)
    • RMQ Consumer (JavaScript)
    • RMQ Consumer (C#)
Powered by GitBook
On this page
  • Connecting to LSports - RabbitMQ
  • Body Scheme
  • Full Snapshot Request

Was this helpful?

  1. RMQ connection

Connection and Consumption setup

PreviousIntegration GuideNextMessage Deserializing

Last updated 6 months ago

Was this helpful?

Connecting to LSports - RabbitMQ

So you've started to implement LSports services via RMQ, great choice! Let's get your connection running with a few simple steps.

This guide is intended to provide a better understanding of how the LSports Support team works to resolve issues in a timely manner and with minimal effort on your part.

The following example refers to these credentials: Username: MyEmail Password: Passw0rd1234 Package: 102030 (You should use the credentials provided by LSports)

Note: All examples below are written in C#.

When implementing your code, you need to get the RMQ library . Please be aware that LSports currently uses version 3.12.10

  1. Start off by making sure that your distributor connection is enabled by sending an API call as follows: - Enable - Disable Method - POST

Body Scheme

{
    "PackageId": PackageId,
    "UserName": "UserName",
    "Password": "Password"
}

Response:

<xs:schema>
  <xs:element name="Message">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Header">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:short" name="HttpStatusCode"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Body">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="Message"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
{
  "type": "object",
  "properties": {
    "Header": {
      "type": "object",
      "properties": {
        "HttpStatusCode": {
          "type": "integer"
        }
      },
      "required": [
        "HttpStatusCode"
      ]
    },
    "Body": {
      "type": "object",
      "properties": {
        "Message": {
          "type": "string"
        }
      },
      "required": [
        "Message"
      ]
    }
  },
  "required": [
    "Header",
    "Body"
  ]
}

If the package was enabled the message should contain "Value was already set". For any other status or error message, please recheck your credentials or contact us.

  1. Create a connection factory as follows:

ConnectionFactory connectionFactory = new ConnectionFactory
{
    HostName = "Described below",
    Port = 5672,
    UserName = "MyEmail",
    Password = "Passw0rd1234",
    AutomaticRecoveryEnabled = true,
    VirtualHost = "StmPreMatch", //For PreMatch
    VirtualHost = "StmInPlay", //For InPlay
    RequestedHeartbeat = 580,
    NetworkRecoveryInterval = TimeSpan.FromSeconds(1)
};

RMQ HostName: InPlay: stm-inplay.lsports.eu PreMatch: stm-prematch.lsports.eu

  1. Create a connection as follows:

IConnection connection = _connectionFactory.CreateConnection();
  1. Create a model as follows:

IModel model = connection.CreateModel();
  1. Configure the quality of service:

model.BasicQos(prefetchSize: 0, prefetchCount: 100, global: false);
  1. Consume message:

EventingBasicConsumer consumer = new EventingBasicConsumer(model);
consumer.Received += (sender, eventArgs) =>
{
    // Deserialize message
    // Call method to handle deserialized message
};
  1. Start message consumption: (make sure to type in your package ID using underscores ('_') as describes) For example, if package ID was “102030”

model.BasicConsume(queue: '_102030_', noAck: true, consumer: consumer)

Full Snapshot Request

Staying Up-to-Date with TRADE360 Data

When you subscribe to a fixture (event) on TRADE360, the first message you receive will be a complete picture, including all data for the fixture and its markets. This is followed by updates (deltas) that only reflect changes to the data.

Reconnecting and Getting Back on Track

If you ever disconnect from the TRADE360 feed, it's important to request a snapshot of the data before you start consuming the feed again. This ensures you have the latest information. You can request a snapshot using an API call. LSports offers two types of snapshots:

By comparing the timestamps of the snapshot data with the timestamps of the updates you receive in the feed, you can identify any missing information and keep your data synchronized.

Possible error types

Note: If the queue reaches 10000 unread/unpacked messages it will be automatically purged and your distributor connection will be disabled.

Most failed connection attempts occur due to incorrect credentials or incorrect connection details. Here are the most common errors and possible solutions:

"Connection failed" - Please check that the connection details i.e. Connection factory, RMQ host, VirtualHost were typed correctly. "Access refused"- Please check that your package is enabled and the login credentials and package ID were typed correctly.

For an in-depth explanation of our data structure, you may continue reading our documentation. Now all you need to do is, to start ordering our sports data according to your specific needs. An email notification will be sent to your contacts upon deletion of your queue

From here you should be able to pull up your RMQ connection and start receiving messages.

- Provides data for all events that are currently inplay.

- Provides data for all events that are currently prematch.

here
https://stm-api.lsports.eu/Distribution/Start
https://stm-api.lsports.eu/Distribution/Stop
Heartbeat
InPlay Snapshot
PreMatch Snapshot