The UOF Java SDK 2.x.x is upgraded to 3.0.0, and this is your roadmap to a smooth transition from your current SDK version to the latest version. The upgrade is designed to elevate your experience and align the SDK more closely with your business needs.
This guide is intended to offer practical advice to ensure your transition is not only efficient but also enhances the performance and capabilities of your software.
You should upgrade the com.sportradar.unifiedodds.sdk.unified-feed-sdk maven dependency to 3.0.0. Before performing the upgrade, it's advisable to consider upgrading certain libraries your project depends on.
The UOF SDK's dependencies have been upgraded, and the revised configuration was tested in Java 8, 11, and 17. The following libraries are affected by this upgrade.
| Upgraded libraries | From | To |
|---|---|---|
| apache http client | 4.5.1 | 5.2.1 |
| rabbitmq.amqp-client | 3.6.0 | 5.17.0 |
| slf4j | 1.7.13 | 2.0.7 |
| guava | 21.0 | 31.1-jre |
| guice | 4.0 | 5.1.0 |
| icu4j | 57.1 | 72.1 |
| snakexml | 1.20 | 2.0 |
| jaxb api | 2.3.0 | 2.3.3 |
| jaxb runtime changed | sun.xml.bind 2.3.0 | org.glassfish.jax 2.3.8 |
| lombok | 1.18.24 | removed |
| opentelemetry-api | - | 1.25.0 (added) |
The root class is renamed from OddsFeed to UofSdk.
You will need to build the configuration before creating a new UofSdk instance.
Example for building it from the properties file:
UofConfiguration config = UofSdk.getUofConfigurationBuilder().buildConfigFromSdkProperties();
UofSdk uofSdk = new UofSdk(new GlobalEventsListener(), config);Review your codebase to identify any parts that might be affected by the upgrade. Look for deprecated methods or classes that have been removed in the new version. Update your code to use the new APIs provided by the UOF Java SDK 3.0.0. This may involve making changes to method calls, imports, and class references. Handle any breaking changes or deprecations by updating your code accordingly. You can contact support if you encounter specific issues.
The following classes and methods are changed. Hence, you will need to update your code to use the new names:
- OddsFeedConfiguration to UofConfiguration
- GlobalEventListener to UofGlobalEventListener
- OddsFeedException to UofException
- OddsFeedConfigurationBuilder to UofConfigurationBuilder
- getOddsFeedConfigurationBuilder to getUofConfigurationBuilder
- OddsFeedListener to UofListener
- OddsFeedSessionBuilder to UofSessionBuilder
- OddsFeedSession to UofSession
- OddsFeed to UofSdk
- SportsInfoManager to SportDataProvider
- CustomisableSDKModule to CustomisableSdkModule
- SDKGlobalEventListener to SdkGlobalEventListener
- SDKProducerListener to SdkProducerListener
- SDKConnectionStatusListener to SdkConnectionStatusListener
- SDKEventRecoveryStatusListener to SdkEventRecoveryStatusListener
- ReplayOddsFeed to UofSdkForReplay
- OddsFeedExt to UofSdkExt
- CustomisableOddsFeed to CustomisableUofSdk
- ReplayFeed to UofSdkForReplay
- Removed OperationManager (properties moved to UofConfiguration)
- EnvironmentSelector - removed SelectIntegration() and SelectProduction() - use SelectEnvironment (SdkEnvironment ufEnvironment)
- Configuration related classes moved to
com.sportradar.unifiedodds.sdk.cfgpackage
| Removed Methods / Classes | Alternative Methods / Classes |
|---|---|
| ConfigurationAccessTokenSetter | TokenSetter |
| OddsFeedConfigurationBuilder | - |
| selectIntegration and selectProduction methods from EnvironmentSelector | selectEnvironment |
| OddsFeedSessionBuilder.setSpecificListeners | - |
| onProducerDown(ProducerDown / producerDown) and onProducerUp (ProducerUp / producerUp) from SdkProducerStatusListener | Producer status messages are now received through onProducerStatusChange (ProducerStatus) only |
| Environment.Staging | Use Environment.Integration instead |
| EventClock.getRemainingDate | Use EventClock.getRemainingTime instead |
| EventsStatus.getApiId | Use EventStatus.getApiName instead |
| MarketDescription.getIncludesOutcomeOfTypes | Use MarketDescription.getOutcomeType instead |
| PeriodStatistics.getTeamStatisticDtos | Use PeriodStatistics.getTeamStatistics instead |
| OutcomeOdds.getOdds() | Use OutcomeOdds.getOdds(OddsDisplayType) instead. To get the same value from getOdds(OddsDisplayType), use outcomeOdds.getOdds(OddsDisplayType.Decimal) |
| OutcomeSettlement.isWinning | Use OutcomeSettlement.getOutcomeResult == OutcomeResult.Won |
| Message.getTimestamp | Use Message.getTimestamps.getCreated instead |
- categoryData.getName
- sportData.getName
- currentSeasonInfo.getNames
- drawResult.getNames
- manager.getNames
- tournamentInfo.getName
- round.getGroupName
Corresponding method removals and constructor argument adjustments were applied on exportableCompleteRoundCi and exportableLoadableRoundCi classes.
-
venue.getCoursessignature was changed from returningList<Hole>toList<Course>to accommodate multiple courses. -
Course entity is introduced and contains the following methods:
List<Hole> getHolesUrn getIdgetNameandgetNamesconsistent with these method semantics elsewhere in the SDK having the same signatures.
Corresponding changes were made to the
ExportableVenueCiclass along with the introduction of theExportableCourseCiclass. -
teamCompetitor.getDivisionmethod was moved up in the inheritance hierarchy to competitor and its signature was changed from returningIntegertoDivisionto accommodate division name. -
Division entity is introduced containing:
Integer getDivisionString getDivisionName
Corresponding changes were made to the
ExportableCompetitorCiclass along with the introduction of theExportableDivisionCiclass. -
timelineEvent.getHomeScoreandtimelineEvent.getAwayScoresignatures were changed from returningdoubletoBigDecimalto make these methods return types consistent with other occurrences of score-related methods elsewhere in the SDK. -
Corresponding changes were made to
ExportableTimelineEventCi. -
Change of behaviour of
round.getName,round.getNames, andround.getPhaseOrGroupLongName. -
round.getNameandround.getNamesmethods now return the value of the "name" property from the Sports API or an empty string if the API does not provide it, and no longer fallback to "group_name" and "group_long_name" attributes. -
round.getPhaseOrGroupLongNamemethod returns the value of the "group_long_name" property from the Sports API or an empty string if the API does not provide it, and no longer falls back to "name" attributes.
The following changes were made to improve consistency:
- URN renamed to Urn.
- Classes within the package
com.sportradar.unifiedodds.sdk.caching.exportableused to have the suffix "CI" likeExportableCIorExportableSportEventCI, which has been renamed to "Ci" likeExportableCiorExportableSportEventCi. This change was applied uniformly to all classes in the package. - All classes within the package
com.sportradar.uf.datamodelused to start with the prefix "UF" likeUFReportingStatusandUFEventStatus. The prefix was renamed to "Uf" likeUfReportingStatusandUfEventStatus. This convention change was applied uniformly across hundreds of classes in the package.
The configuration settings were split between the configuration class and OperationManager. OperationManager is removed and all settings are consolidated within the UofConfiguration interface.
You have three choices for constructing the final configuration through:
- Properties file
- YAML file
- Programmatically using ConfigurationBuilder
Certain options that were previously available in properties and YAML files have been removed and can exclusively be configured using the configuration builder.
You'll need to re-configure the following either in the properties file or YAML:
| Keys | Required/Optional | Comments |
|---|---|---|
| accessToken | required | The token you are currently using can also be used with our new version. |
| defaultLanguage or desiredLanguages | required | desiredLanguages is renamed from desiredLocales. |
| nodeId | optional | Recommended to be set – must be unique per SDK instance. |
| environment | optional | If not set, 'Integration' will be used. Renamed from ufEnvironment. |
| inactivitySeconds | - | This is removed from properties and YAML files. However, you can set this through the configuration builder. |
| messagingHost | optional | Sets the URL of the messaging host (broker), e.g., mq.betradar.com. This setting is used only when using a custom environment. |
| messagingUseSsl | optional | Sets the value indicating whether a secure connection to the message broker should be used. Renamed from useMessagingSsl. |
| messagingVirtualHost | optional | Sets the name of the virtual host configured on the messaging server (broker). This setting is used only when using a custom environment. |
| apiHost | optional | Sets the URL of the API host, e.g., https://api.betradar.com. This setting is used only when using a custom environment. |
| apiUseSsl | optional | Sets the value indicating whether a secure connection to the Sports API should be used. Renamed from useApiSsl. |
| exceptionHandlingStrategy | optional | Sets an ExceptionHandlingStrategy enum member specifying how to handle exceptions thrown to outside callers (‘Catch’ or ‘Throw’). |
| disabledProducers | optional | Sets the comma-delimited list of IDs of disabled producers, e.g., 1,2,7,9. |
| maxRecoveryTime | optional | This is removed from properties and YAML files. However, you can set this through the configuration builder. |
| adjustAfterAge | optional | This is removed from properties and YAML files. However, you can set this through the configuration builder. |
| httpClientTimeout | optional | This is removed from properties and YAML files. However, you can set this through the configuration builder. |
| recoveryHttpClientTimeout | optional | This is removed from properties and YAML files. However, you can set this through the configuration builder. |
The full configuration can also be set up via the ConfigurationBuilder obtained via uofSdk.getUofConfigurationBuilder(). The resulting UofConfiguration contains all the previously set configurations for the SDK.
Thoroughly test your project after making the changes. Test all critical functionality to ensure that everything still works as expected. Pay special attention to any areas of your setup that interact with the UOF Java SDK, as these are likely to be the most affected by the upgrade.
Update your project's documentation and any training materials to reflect the changes introduced by the upgrade. This will help your team members understand and work with the new version.
Once you are confident that your project works correctly with the upgraded UOF Java SDK, you can deploy the updated version to your production environment.
After deployment, monitor your project closely for any unexpected issues or performance problems. Be prepared to address any post-upgrade issues promptly.
If you encounter any bugs or issues in the UOF Java SDK 3.0.0, consider reporting them to support@sportradar.com. Providing feedback can help improve the SDK for future releases.