Public Repository

Last pushed: 2 months ago
Short Description
Mock betting feed for tech test
Full Description

Provider Feed

The provider feed service is a mock service designed to represent a proprietary data feed.

The service exposes a TCP port 8282 that once connected to will generate a stream of packets. Each packet is terminated by a new line and the values within each packet are separated by a pipe, but note that values can also contain escaped pipes.

Example Packet

|2054|create|event|1497359166352|ee4d2439-e1c5-4cb7-98ad-9879b2fd84c2|Football|Sky Bet League Two|\|Accrington\| vs \|Cambridge\||1497359216693|0|1|

The beginning of each packet contains some header values. The header is a fix number of values for all packets. The values in the header are as follows:

  • msgId - This is an incremental integer unique to each packet
  • operation - This is a string value that will be either create or update
  • type - This is a string value that denotes the packet type, which will be either event, market or outcome
  • timestamp - This is an integer value of the clock time when the packet was sent (in milliseconds)

All the remaining values after the header should be referred as the packet body. To see the field names and data types to use for each value please see the types endpoint on the provider feed: http://localhost:8181/types

Data Hierarchy

The packets received via the TCP port represent a mock betting feed. In this feed there are 3 main data types:

  • Event - This is the root level data for a given fixture, such as a football or tennis match. The values in the event relate to the start time and the competitors playing.
  • Market - These are children of a specific event and the values represent a betting opportunity such as Full Time Result or Match Result.
  • Outcome - These are children of a specific market and each one represents the winning result of a betting opportunity such as Man U, Draw or Liverpool for a Full Time Result.
Event
  |
  |--> Market
  |      |
  |      |--> Outcome
  |      |--> Outcome
  |      |--> Outcome
  |
  |--> Market
         |
         |--> Outcome
         |--> Outcome

All data types include 2 state values:

  • displayed - Indicates whether the event, market or outcome should be shown to a customer.
  • suspended - Indicates whether the bets can be placed against the betting opportunity. Bets should not be accepted when suspended is true.

Data Order

The packets received via the TCP port represent the data hierarchy above for hundreds of fixtures. The order of the data is very important to ensure the parent -> child hierarchy can be processed successfully.

For a each fixture an create event packet will be sent first followed by a create packet for each market and packets for its child outcomes. After all the create packets for a fixture have been sent you will receive random update packets for different levels of the hierarchy.

All packets will be sent with a unique message ID that is an incremental integer for each new packet. You will always receive packets in sequential order.

Misc.

  • There is a connection limit of 1 active client on the TCP port
  • If the client disconnects then the packets will be queued
  • If the provider service is restarted then the sequential msgId is reset back to 0
  • Data feeds do not persist across restarts. If you restart the provider service all previous feed data will be lost
Docker Pull Command
Owner
sbgfeedme

Comments (0)