Examples

This section provides a set of 10 runnable examples designed to help you get started quickly with the Unified Odds Feed SDK.

All examples are provided in Java, to make the tutorial consistent, we’ll be using IntelliJ IDEA as the development environment for Java. However, the same Java code can be run on any IDE or environment capable of running Java (such as Eclipse, VS Code, or CLI builds with Maven/Gradle).

Prerequisites

Before you start with these examples, make sure you have the following:

  1. Development Environment

    • IntelliJ IDEA (preferred for this tutorial), or any Java IDE such as Eclipse or VS Code.

    • Java 8 or higher installed.

  2. Project Setup

    • Access to the UofSdk Java project repository.

    • Maven or Gradle configured if you plan to build from CLI.

  3. Access Credentials

    • A valid integration token to connect to the Unified Odds Feed.

  4. Basic Knowledge

    • Familiarity with Java programming concepts.

    • Understanding of SDK initialization and running simple Java programs.

Available Examples

You can choose from the following examples when starting the SDK. Each example demonstrates a specific usage pattern or architecture for working with the Unified Odds SDK.

1. Basic SDK Setup

This example runs a single UofSession with MessageInterest.AllMessages, and performs a full odds recovery from all producers. You’ll see how to initialize the SDK, use a GlobalEventsListener to receive global events, and a MessageListener to process incoming odds messages.

Interactive Demo:

Follow along by clicking the buttons to explore the UofSdk Basic example step by step.

Output:

2. Multi-Session Architecture

This example runs three parallel UofSessions — Prematch, Live, and Virtuals — each with filtered MessageInterest types. You’ll see how to configure session isolation, apply message filtering, and handle concurrent events across multiple sessions.

Follow along by clicking the buttons to explore the Multi Session example step by step.

Output:

3. Timestamp-Based Recovery

This example runs a single UofSession with ProducerManager to recover data from the last 2 hours using setProducersRecoveryTimestamp(). You’ll see how to perform historical data recovery, manage producers, and synchronize using timestamp-based recovery.

Follow along by clicking the buttons to explore the Timestamp Based-Recovery example step by step.

Output:

4. Full Message Data Access

This example uses a DataSessionSetup with a DataMessageListener to inspect complete message payloads. You’ll see how to access raw message data, parse events in detail, and explore the underlying data structures.

Follow along by clicking the buttons to explore the Full Message Data Access example step by step.

Output:

5. Market Descriptions API

This example uses MarketDescriptionManager.getMarketDescriptions() to enumerate static metadata. You’ll see how to access market metadata, work with static data APIs, and understand betting market structures.

Follow along by clicking the buttons to explore the Market Description API example step by step.

Output:

6. Market Mappings Analysis

This example uses MarketDescriptionManager with mapping data to manage outcome and specifier relationships. You’ll see how to work with market variant mappings, translate outcomes, and handle specifiers effectively.

Follow along by clicking the buttons to explore the Market Description API example step by step.

Output:

7. Replay Server Integration

This example uses UofSdkForReplay with a ReplayManager to simulate historical events. You’ll see how to set up a replay environment, play back historical data, and run controlled testing scenarios.

Follow along by clicking the buttons to explore the Market Description API example step by step.

Output:

8. Sport Event Data Explorer

This example uses SportEventDataPrinter to access the static sport hierarchy and event metadata. You’ll see how to explore sport data structures, navigate event hierarchies, and work with tournament and competition APIs.

Follow along by clicking the buttons to explore the Market Description API example step by step.

Output:

9. Advanced Configuration

This example uses a custom UofConfiguration that goes beyond the default properties, adjusting timeouts, caching, and locales. You’ll see how to apply configuration builder patterns, select environments, and fine-tune advanced settings.

Follow along by clicking the buttons to explore the Market Description API example step by step.

Output:

10. Cache Export/Import

This example shows how to use SDK cache serialization and deserialization to maintain state across restarts. You’ll see how to manage cache data, ensure state persistence, and optimize performance.

Follow along by clicking the buttons to explore the Market Description API example step by step.

Output:

Last updated

Was this helpful?