1. I downloaded the SDK library, but I am unsure how / where to start
From the SDK section, you can navigate to the SDK source code GitHub repository, where each version includes an associated example project. In the example, the methods used to dispatch messages to the user only log various information, but this is always a good place to start using the SDK. Starting the SDK requires an access token, which can be obtained from the Integration Manager or the Sales team.
2a. I cannot build UofConfiguration - an exception is thrown on the Build method
2b. The SDK cannot connect to the feed - an exception is thrown by the uofSdk.Open(...) method
3. A producer never gets marked as "up"
4. A producer(s) is/are periodically marked as "down"
5. Do I have to take care of "recovery" when using the SDK?
No, the SDK handles recovery for every producer that is "active" ("available producers" endpoint on iodocs) and is not disabled in the SDK. The type of recovery made depends whether the user provided the timestamp of the last message received before starting the SDK. If no value is provided, the SDK makes a "full odds recovery" (the user will get the current odds for all matches associated with that producer) requesting as large time frame worth of messages to be recovered as a particular producer allows for; otherwise the SDK will make a "partial recovery" (the user will get the latest odds for all events which have changed and all stateful messages send after the provided timestamp).
User cannot manually start recovery process.
6. I don't want to process all messages in the same process / on the same machine to ensure better performance.
Different sessions / combinations of sessions can be created on the UofSdk object. The sessions allow to filter the messages based on their priority(hi / low priority), or based on whether the messages are associated with live, prematch and virtual events. Recommended approach is to have separate instances consuming messages from live, pre-match and virtual producers. Even though the SDK does not provide a way to subscribe messages on a per-sport basis, this can be achieved via filtering messages on the client side without excessively degrading efficiency.
7. I am using the SDK in multiple processes / machines and each time one SDK makes a recovery all SDKs get recovery messages which reduces performance.
Use the nodeId configuration property and assign it a different values in different instances. This will ensure that only the SDK instance, which requested the recovery, receives the recovery messages. The same property should be used on replay server to only receive messages replayed by a specific SDK.
8. I am a software/platform provider and/or need to access odds from different feeds belonging to multiple bookmakers in the same process
Currently SDK does not support that. The recommended approach is creating multiple SDK instances (with different configurations / tokens) and each instance will receive it's own messages.
9. How to get your first data?
You can just connect to the feed and populate the database with all the data "on-the-fly". The feed indeed gives you only IDs, however, the SDK contains methods which you can use and will get all the additional information you need from the API (e.g. marketDescriptions, fixtures, competitors, names, etc.).
However, if you would like to populate your database in advance, you can use several interfaces and their methods that are available in the SDK. Especially using the interfaces you can get on UofSdk.
JAVA - to get sport event for tomorrow
Date tomorrow = new Date();
Calendar c = Calendar.getInstance();
c.setTime(tomorrow);
c.add(Calendar.DATE, 1);
tomorrow = c.getTime();
List<Competition> sportEvents = sportDataProvider.getCompetitionsFor(tomorrow);
for(Competition competition: sportEvents)
{
if (competition instanceof Match) {
Match match = (Match) competition;
Fixture fixture = match.getFixture();
}
}JAVA - Getting sports, categories, tournaments, matches
List<Sport> sports = sportDataProvider.getSports();
for(Sport sport : sports) {
Urn sportId = sport.getId();
String sportName = sport.getName();
List<Category> categories = sport.getCategories();
for(Category category : categories) {
Urn categoryId = category.getId();
String categoryName = category.getName();
List<SportEvent> tournaments = category.getTournaments();
for(SportEvent sportEvent : tournaments) {
if(sportEvent instanceof Tournament) {
Tournament tournament = (Tournament)sportEvent;
Urn tournamentId = tournament.getId();
String tournamentName = tournament.getName();
List<Competition> schedule = tournament.getCurrentSeason().getSchedule();
for (Competition competition : schedule) {
Urn competitionId = competition.getId();
List<Competitor> competitors = competition.getCompetitors();
if(competition instanceof Match) {
Match match = (Match)competition;
Fixture fixture = match.getFixture();
}
}
}
}
}
}.NET - Get all sport events for tomorrow
var sportEvents = await sportDataProvider.GetSportEventsByDateAsync(DateTime.Now.AddDays(1), CultureInfo.CurrentCulture);foreach (var sportEvent in sportEvents){ var match = sportEvent as IMatch; var matchFixture = await match?.GetFixtureAsync(); // use other methods to get other data} |
|---|
.NET - Getting sports, categories, tournaments, matches
// With the SportDataProvider you can access various data about the ongoing eventsISportDataProvider sportDataProvider = oddsFeed.SportDataProvider; // get all sportsvar sports = sportDataProvider.GetSportsAsync().GetAwaiter().GetResult();// iterate through sports, get all categories, tournaments, schedule for each tournamentforeach (ISport sport in sports){ var sportName = sport.GetName(CultureInfo.CurrentCulture); var categories = sport.Categories; foreach (ICategory category in categories) { var categoryName = category.GetName(CultureInfo.CurrentCulture); var tournamets = category.Tournaments; foreach (ISportEvent sportEvent in tournamets) { var tournamentName = sportEvent.GetNameAsync(CultureInfo.CurrentCulture).GetAwaiter().GetResult(); var tournament = sportEvent as ITournament; // get schedule for current season var schedule = tournament?.GetCurrentSeasonAsync().Result.Schedule; foreach (var scheduledSportEvent in schedule) { var match = scheduledSportEvent as IMatch; var matchFixture = match?.GetFixtureAsync().GetAwaiter().GetResult(); // use other methods to get other data } } }} |
|---|
10. What does SetAdjustAfterAge do?
Normally, the max window for recovery is 3-72 hours (depending on the producer).
If clients are disconnected for longer than max hours, but the SDK is still running, the SDK will then automatically have the recovery timestamp older than max hours.
If that happens, SetAdjustAfterAge then defines what should happen:
11. How to use UOF Java SDK with Java 11 or greater?
Recommended version of UOF SDK to be used is v3.x.x. It was tested to be working with java 8, java 11 and java 17.
When using UOF SDK version v2.x.x, Java 11 doesn't contain some of the libraries in its core, some of the libraries the SDK is using internally have to be added as dependencies. To do so, you should normally add the following to the pom.xml file (inside <dependencies>...</dependencies> ):
Expand source
12. How to resolve PKIX certificate exception with Java SDK
In some cases, Java SDK can raise the following exception:
"Caused by sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target".This is raised because of a missing certificate JVM is unable to obtain for some reason.
|openssl s_client -connect stgapi.betradar.com:443 </dev/null \\| openssl x509 -out stgapi.betradar.com.cert|
|------------------------------------------------------------------------------------------------------------|
java -version |
|---|
keytool -import -noprompt -trustcacerts \-alias stgapi.betradar.com -file stgapi.betradar.com.cert \-keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/security/cacerts -storepass changeit |
|---|
keytool -list -v -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/lib/security/cacerts -storepass changeit -alias stgapi.betradar.com |
|---|
13. How to resolve the "Invalid char 2-3 byte order" issue in Java?
In case Java SDK raises an exception containing: ... Invalid character 2-3 bytes ... .
This issue is only present in some specific environment and circumstances and is normally caused by the client's environment (due to incorrect encoding).
To resolve this issue, the client should add "-Dfile.encoding=UTF-8" to their JVM run configuration which enforces using UTF-8 encoding to be used.
14. How to solve CultureNotFoundException in .NET SDK?
Custom CultureInfos were not supported until Windows 10. If the SDK is running on an older OS (Windows 7 or older), CultureNotFoundException (Culture is not Supported) is thrown in case a custom CultureInfo such as "srl" is created (e.g. new CultureInfo("srl")).
Unfortunately, there is no other solution available than updating the OS to Windows 10 or newer.