UnifiedFeed SDK is a client library that enables easier integration with the Betradar XML feeds. SDK exposes XML feed service interface in a more user-friendly way and isolates the client from having to do XML feed parsing, proper connection handling, error recovery, event queuing, data caching and dispatching.
Migrating SDK configuration to Microsoft.Extensions.Configuration.* libraries. This gives:
SDK independence from file format (JSON, XML, etc);
Makes it easier to merge values from the configuration file with environment variables, which is especially important for container environments.
Added the ability to replace endpoints related to the Integration API,Recovery API via config file, the original endpoints are saved as default. This gives:
It possible to replace endpoints without rebuilding the SDK;
An example of a new configuration:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<section name="oddsFeedSection" type="Sportradar.OddsFeed.SDK.API.Internal.OddsFeedConfigurationSection, Sportradar.OddsFeed.SDK" />
</configSections>
<!--
Required attributes:
accessToken - the access token used for the authentication to the broker and to the sports api
Optional attributes:
inactivitySeconds - sets the max time window between two messages before the producer is market as "down" (between 20 and 180 seconds; default: 20)
host - sets the URL of the messaging host (broker) (mq.betradar.com)
virtualHost - sets the name of the virtual host configured on the messaging server (broker)
exchange - sets the exchange to which queues are bound on the messaging server (broker)
apiHost - sets the URL of the API host (https://api.betradar.com)
useSSL - sets the value indicating whether a secure connection to the message broker should be used (true or false)
supportedLanguages - sets the comma delimited string of all languages (en,de,nl)
useIntegrationEnvironment - sets a value indicating whether the unified feed integration environment should be used (true or false)
exceptionHandlingStrategy - sets a ExceptionHandlingStrategy enum member specifying how to handle exceptions thrown to outside callers (ExceptionHandlingStrategy.CATCH or ExceptionHandlingStrategy.THROW)
disabledProducers - sets the comma delimited list of ids of disabled producers (1,2,7,9)
maxRecoveryTime - sets the timeout for recovery to finish (minimum 900 sec)
nodeId - sets the node id for this instance of the sdk (recommended when running multiple instances). MTS customer must set this value! Use only positive numbers; negative are reserved for internal use.
adjustAfterAge - gets the indication whether the after age should be adjusted before executing recovery request
httpClientTimeout - sets the timeout for HTTP responses used to fetch data from API (between 10 and 100 seconds; default: 30)
recoveryHttpClientTimeout - sets the timeout for recovery HTTP responses used to fetch data from API (between 10 and 100 seconds; default: 30)
-->
<oddsFeedSection accessToken="accessToken" apiHost="apiHost" host="host" port="port" virtualhost="virtualhost" exchange="exchange" username="username" defaultLanguage="en" nodeId="1">
<endpoints>
<!-- Bookmaker -->
<BookmakerDetailsProvider baseUrl="{0}/v1/users/whoami" />
<NonMappingDataProvider baseUrl="/v1/descriptions/producers" />
<!-- Sport data -->
<competitorProfileProvider baseUrl="/v1/sports/{1}/competitors/{0}/profile" />
<fixtureEndpointDataProvider baseUrl="/v1/sports/{1}/sport_events/{0}/fixture" ReplayUrl="/sports/{1}/sport_events/{0}/fixture" />
<fixtureChangesProvider baseUrl="/v1/sports/{0}/fixtures/changes" />
<sportEventSummaryProvider baseUrl="/v1/sports/{1}/sport_events/{0}/summary" />
<dateScheduleProvider baseUrl="/v1/sports/{1}/schedules/{0}/schedule" />
<allSportsProvider baseUrl="/v1/sports/{0}/sports" />
<!-- Descriptions -->
<MatchStatusDataProvider baseUrl="/v1/descriptions/{0}/match_status" />
<invariantMarketDescriptionsProvider baseUrl="/v1/descriptions/{0}/markets" />
<!-- Tournaments -->
<allTournamentsProvider baseUrl="/v1/sports/{0}/tournaments" />
<availableSportTournaments baseUrl="/v1/sports/{0}/sports/{1}/tournaments" />
<tournamentScheduleProvider baseUrl="/v1/sports/{1}/tournaments/{0}/schedule" />
<!-- Recovery -->
<afterTimestampRecovery baseUrl="{0}/recovery/initiate_request?after={1}&request_id={2}" />
<fullOddsRecovery baseUrl="{0}/recovery/initiate_request?request_id={1}" />
<eventMessagesRecovery baseUrl="{0}/odds/events/{1}/initiate_request" />
<eventStatefulMessagesRecovery baseUrl="{0}/stateful_messages/events/{1}/initiate_request" />
</endpoints>
</oddsFeedSection>
</configuration>
Type of change
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected): this change requires configuration injection (IConfiguration) from the client side.
How Has This Been Tested?
Partial testing using new configuration options:
Overriding values: exchange, endpoint's;
Overriding the value through environment variables.
Test projects have not been verified, so the PR is marked WIP.
Checklist:
[x] My code follows the style guidelines of this project
[x] Any dependent changes have been merged and published in downstream modules
Remarks
This PR is currently aimed at obtaining feedback on both the implementation and the very possibility of their merging into upstream. If the introduction of such changes is not intended, then there is probably no point in this PR.
Description
Migrating SDK configuration to
Microsoft.Extensions.Configuration.*
libraries. This gives:JSON
,XML
, etc);Added the ability to replace endpoints related to the
Integration API
,Recovery API
via config file, the original endpoints are saved as default. This gives:An example of a new configuration:
Type of change
IConfiguration
) from the client side.How Has This Been Tested?
Partial testing using new configuration options:
exchange
,endpoint
's;Overriding the value through environment variables.
Test projects have not been verified, so the PR is marked WIP.
Checklist:
Remarks
This PR is currently aimed at obtaining feedback on both the implementation and the very possibility of their merging into upstream. If the introduction of such changes is not intended, then there is probably no point in this PR.