Replay

The replay server can be used to replay pre-recorded matches or recently offered matches. You can replay all messages sent for a particular sport event (older than 48hrs) using the replay server. In general, the matches are replayable forever. However, Betradar reserves the right to remove events that are older than 2 years.

Scenarios

Using the replay server functionally is especially useful during the integration period. You can replay one or more sport events or one of the predefined scenarios (currently 3 are available). Scenarios are sets of sport-events/matches that are prepared by Betradar.

Instead of adding individual matches, you can add a complete scenario. The sport-events in scenarios will be emitted faster since they are cached, and it is recommended that you use the scenarios for i.e. stress testing.

Please note that

  • When using the replay server, invoking recovery requests is disabled

  • No producer down/up in a replay session (no heartbeat checking is performed)

  • The setting "DisabledProducers" is ignored.

Configuration for Replay

When integrating with UOF SDK user can use the "UofSdkForReplay" root object (instead of UofSdk) which provides the ReplayManager property through which the user can easily define what should be replayed.

OddsFeedConfiguration configReplay = OddsFeed
            .getOddsFeedConfigurationBuilder()
            .setAccessToken(token)
            .selectReplay()
            .setSdkNodeId(123)
            .setDefaultLocale(Locale.ENGLISH)
            .setExceptionHandlingStrategy(ExceptionHandlingStrategy.Throw)
            .build();
 
ReplayOddsFeed replayFeed = new ReplayOddsFeed(new GlobalEventsListener(), config);
 
OddsFeedSessionBuilder sessionBuilder = replayFeed.getSessionBuilder();
sessionBuilder
            .setListener(new CustomMessageListener("LiveMessagesOnly", oddsFeed, config.getDesiredLocales()))
            .setMessageInterest(MessageInterest.LiveMessagesOnly)
            .build();
sessionBuilder
            .setListener(new CustomMessageListener("PrematchMessagesOnly", oddsFeed, config.getDesiredLocales()))
            .setMessageInterest(MessageInterest.PrematchMessagesOnly)
            .build();
 
logger.info("Feed open");
// Open the feed with all the built sessions
replayFeed.getReplayManager().stop();
replayFeed.getReplayManager().clear();
replayFeed.open();
         
boolean addResponse = replayFeed.getReplayManager().playScenario(1);
ReplayStatus replayStatus = replayFeed.getReplayManager().getPlayStatus();
writeReplayStatus(replayStatus, logger);
 
List<SportEvent> queueEvents = replayFeed.getReplayManager().getReplayList();
logger.info("Currently {} items in queue.", queueEvents.size());
 
// wait till all feed messages are processed. Let's sleep awhile (30 minutes) and see what gets printed.
Thread.sleep(1000 * 60 * 30L);
 
replayFeed.close();
logger.info("Feed close");

Last updated

Was this helpful?