Web Socket API - Process implementation Confirmation
Dear @umer.nalla , @wasin.waeosri,
We have implemented Websocket API to consume data from Refinitiv Real-Time by creating a Websocket connection to the Advanced Distribution Server (ADS) component of Refinitiv Real-Time Distribution System.
We are following the following process to fetch rates every 10 secs. Please let us know in case of any comments or issues process wise for the same.
1. Call Authentication and fetch access Token
2. Establishing a Websocket connection to the server and Login with the access token generated
{
"ID": 1,
"Domain": "Login",
"Key": {
"NameType": "AuthnToken",
"Elements": {
"AuthenticationToken": "eyJ0eXA...gZ9d8kCpeng",
"Position": "10.100.30.35",
"ApplicationId": "256"
}
}
}
3. If Login is successful then Sending a ‘Batch’ request for multiple data items
{"ID":2,"Key":{"Name":["GBP=","INR=","CAD=","JPY=","DKK=","EUR="]},"Service":"ELEKTRON_DD"}
4. Once socket responds to a Batch request
a. Closing items (Closing multiple streams ) as per Ids received
{"ID":[4, 7, 3, 5, 6],"Type":"Close"}
6. Logoff from server and close all open streams
{"ID":1,"Type":"Close","Domain":"Login"}
Best Answer
-
Hello @kishore.karanam
Could you please let me know if you want to connect to a local Advanced Distribution Server (ADS) in your environment or to RTO (Real-time Optimized) on the cloud? Based on your previous post, you said you will connect to the RTO, not the local deployed ADS.
RTO Case
The steps above are correct for the RTO scenario. Please note that you can keep the WebSocket connection alive via the following steps:
- re-authenticate with RDP API using a refresh token before token expiration to get a new token
- Re-issue login request to the WebSocket server with a new access token before token expiration to keep session open.
The other important thing is you need to send a Pong message back to the server if the server sends a Ping message to the application. These ping-pong messages act as a heartbeat mechanism between the client and server.
Local RTDS Case
However, if you want to connect to your local deploy ADS server, steps 3 - 6 are the same.
If your local ADS already connects to the DACS server (Data Acess Control System Server), you do not need to get the access token from the RDP API Auth service. You can log in to the ADS server with the following JSON login request message:
{
"Domain": "Login",
"ID": 1,
"Key": {
"Elements": {
"ApplicationId": "256",
"Position": "<You IP Address>"
},
"Name": "DACS Username"
}
}Please find more detail from the Connect to Refinitiv Real-Time Distribution System tutorial.
Additionally, is there a particular reason you are using Websocket API rather than EMA Java as recommended in an earlier post?
EMA Java is generally much simpler to use than Websocket API and also delivers a higher performance level than Websocket API.
0
Answers
-
The other thing to clarify is that we would not recommend you keep logging off and Login again every 10 secs - unnecessary processing and bandwidth usage.
As my colleague mentioned, you can keep the connection + session alive by refreshing the token (for RTO only) and sending Pong messages (RTO and RTDS).
And then you can just send your Batch request every 10 secs. Furthermore, if you send the request as a Non-Streaming snapshot request, you don't need to close the stream - the server will close the stream once it responds with the data (or status message for invalid request).
You can combine Batch with Snapshot by just adding the Streaming : False to your Batch Request e.g.
{
"ID":2,
"Key":{
"Name":[
"VOD.L",
"BT.L",
"BP.L"
],
"Service":"ELEKTRON_DD"
},
"Streaming":false
}0 -
Dear wasin.waeosri , umer.nalla
We are using RTO (Real-time Optimized) on the cloud.
Kindly let us know more details/links/Sample Client etc regarding fetching rates through EMA Java.
0 -
Hello @kishore.karanam
You can download the RTSDK Java package which included the EMA Java API library files, example code, documents, etc from the Real-Time SDK Java download page. I highly recommend you check the RTSDK Build System page regarding how to build and run the API.
I suggest you check the example ex113_MP_SessionMgmt which connects and consumes data from the RTO endpoint. If you are interesting the Service Discovery feature, you can check the ex450_MP_QueryServiceDiscovery example.
You can find more detail about the EMA Java API with the RTO connection from the following resources:
There are two videos tutorials that might help you too.
1
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛