How sportradar/unifiedoddssdkjava works
Purpose and Modules
This is a Java 4.x client SDK for Sportradar Unified Odds: it combines real-time odds-feed subscriptions with REST retrieval of sports, event, market, and custom-bet data. The production artifact is sdk-core; sdk-example is a runnable integration/reference client.
• sdk-core/pom.xml
• sdk-example/pom.xml
Public Entry Points
Consumers configure and create UofSdk, register global and per-session listeners, create one or more sessions with message-interest filters, then call open(). UofSdkForReplay exposes replay-oriented operation; UofSdkExt adds routing-key-aware callbacks.
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/UofSdk.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/UofSessionBuilder.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/extended/UofSdkExt.java
Configuration and Runtime Composition
Public builders produce UofConfiguration, covering access token, environment, API, RabbitMQ, cache, producer, recovery, and usage settings. Internal configuration readers support properties/YAML, while a modular DI composition layer assembles transports, caches, message processing, data providers, and observability.
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/cfg/ConfigurationBuilder.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/cfg/SdkConfigurationYamlReader.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/di/MasterInjectionModule.java
Feed Ingestion and Dispatch
RabbitMQ/AMQP is the primary streaming boundary. Connection factories, channel supervision, TLS/socket handling, and a message receiver maintain feed connectivity. Routing keys classify deliveries; consumers validate, deserialize, construct typed odds messages, update internal state, and invoke registered session/global listeners. Sessions isolate callbacks and can split high- and low-priority traffic.
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/rabbitconnection/SdkConnection.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/ChannelMessageConsumerImpl.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/CompositeFeedMessageProcessor.java
Typed Domain Boundary
The SDK hides feed XML behind public interfaces for odds lifecycle messages—odds changes, bet stops, settlements/cancellations, producer status, recovery, and fixture changes—and rich sport/event entities. Internal factories implement these API contracts, keeping provider wire schemas separate from consumer-facing models.
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/oddsentities/Message.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/oddsentities/OddsChange.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/entities/SportEvent.java
REST Data, Caching, and Markets
HTTP data providers retrieve Sportradar sports API resources; routers coordinate requests and hydrate caches for sports/events, profiles, statuses, translations, and localized market descriptions. SportDataProvider and market managers are the public read boundary. Market naming/mapping resolves specifiers and localized descriptions from cached/API data.
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/managers/SportDataProvider.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/caching/impl/DataRouterManagerImpl.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/markets/MarketManagerImpl.java
Resilience, Recovery, and Operations
Producer management tracks upstream availability. Recovery coordinates snapshot/recovery requests after connection loss or restart, then surfaces recovery/producer state through listeners. The runtime uses scheduled tasks, provides traffic logging, JMX statistics, and telemetry/usage metrics. External dependencies are Sportradar REST endpoints and RabbitMQ; schemas bundled in resources define feed and API payload contracts.
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/recovery/RecoveryManagerImpl.java
• sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/common/telemetry/TelemetryImpl.java
• sdk-core/src/main/resources/xsd/messages/UnifiedFeed.xsd
Main entry points: MasterInjectionModule.java DI composition · UofSdk.java UofSdk · CompositeFeedMessageProcessor.java Feed message processor · SdkConnection.java AMQP feed connection
Components 19
Consumer API
- sdk-example · Runnable integration example.
sdk-example/pom.xml - UofSdk · Main lifecycle and listener entry point.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/UofSdk.java - Session builder · Creates filtered feed sessions.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/UofSessionBuilder.java - UofSdkExt · Adds routing-key-aware callbacks.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/extended/UofSdkExt.java - Configuration builder · Builds access, transport, cache, recovery, and usage settings.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/cfg/ConfigurationBuilder.java - Sport data provider · Consumer boundary for sports and event data.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/managers/SportDataProvider.java - Typed odds and sport entities · Wire-schema-independent messages and sport events.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/oddsentities/Message.java
Core Runtime
- DI composition · Assembles transports, processors, caches, providers, and operations.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/di/MasterInjectionModule.java - YAML configuration reader
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/cfg/SdkConfigurationYamlReader.java - AMQP feed connection · Manages connections, channels, TLS, and feed delivery.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/rabbitconnection/SdkConnection.java - Channel consumer · Receives and classifies routing-key deliveries.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/ChannelMessageConsumerImpl.java - Feed message processor · Validates, deserializes, updates state, and dispatches callbacks.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/CompositeFeedMessageProcessor.java - Data router and cache · Fetches and hydrates cached sports, events, profiles, and translations.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/caching/impl/DataRouterManagerImpl.java - Market manager · Resolves market mappings, specifiers, and localized names.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/markets/MarketManagerImpl.java - Recovery manager · Coordinates snapshot and recovery after disruption.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/impl/recovery/RecoveryManagerImpl.java - Telemetry · Emits SDK usage and operational metrics.
sdk-core/src/main/java/com/sportradar/unifiedodds/sdk/internal/common/telemetry/TelemetryImpl.java
External Boundaries
- RabbitMQ
- Sportradar REST API
- Feed and API schemas · Defines provider payload contracts.
sdk-core/src/main/resources/xsd/messages/UnifiedFeed.xsd
Connections 22
- sdk-example → UofSdk: uses
- Configuration builder → UofSdk: configures
- UofSdk → Session builder: creates
- UofSdkExt → UofSdk: extends
- UofSdk → DI composition: opens runtime
- YAML configuration reader → Configuration builder: loads
- DI composition → AMQP feed connection: assembles
- DI composition → Data router and cache: assembles
- DI composition → Market manager: assembles
- DI composition → Recovery manager: assembles
- DI composition → Telemetry: enables
- RabbitMQ → AMQP feed connection: feed deliveries
- AMQP feed connection → Channel consumer: delivers
- Channel consumer → Feed message processor: routing-key messages
- Feed message processor → Typed odds and sport entities: constructs
- Feed message processor → Session builder: dispatches callbacks
- AMQP feed connection → Recovery manager: connection state
- Recovery manager → Feed message processor: recovery messages
- Sportradar REST API → Data router and cache: sports resources
- Data router and cache → Sport data provider: serves cached data
- Data router and cache → Market manager: market descriptions
- Feed and API schemas → Feed message processor: payload contracts