Refinitiv web socket connection issue
Hello, has anyone come across below issues:
1) Sometimes websocket connection is not establishing
2) Sometimes there is no response from Refinitiv
How to solve this issue?
Best Answer
-
Could you please clarify the "We are generating a new access token every 5 seconds" message? Why does the application refresh token every 5 seconds?
It would be nice if you can post a cutdown version of your code that can replicate the issue to let us check in detail.
### RTO Access Token time ###
The Access Token expiration time is based on the "expires_in" information value. The default expires_in is 600 seconds (10 minutes), so the application should refresh a token with RDP and re-send a new access token to the WebSocket server every 90% of the initial time before it expires (aka 9 minutes), not every 5 seconds.
### RTO Workflow ###
Please let me explain more about the RTO WebSocket connection workflow. The WebSocket - RTO connection workflow is a mix of the RDP APIs HTTP and WebSocket API workflows. The workflow summaries are as follows.
- Send an HTTP Post message with a Password Grant credential (grant_type=password) to the RDP API Authentication service (http://api.refinitiv.com/auth/oauth2/v1/token URL) and obtain an access token, refresh token, and session expiration interval for your application.
- Then requests the list of the RTO streaming server endpoints with the RDP APIs Pricing service (https://api.refinitiv.com/streaming/pricing/v1/) via HTTP request
- Establish a WebSocket connection to the desired RTO WebSocket server.
- Once the application receives a connection confirmation via the on-connect callback method, send a JSON login message to the WS server with an access token.
- Once the application receives a login refresh message from the WS server, the application can start a data flow such as requesting data
- Re-authenticate with RDP API Authentication using a Refresh Grant credential (grant_type=refresh_token) before token expiration (“expires_in” seconds) to get a new token
- Re-send a JSON login request with a new access token to the WS server before token expiration to keep the session open.
- Repeat steps (6) and (7) before the “expires_in” time exceed
- The WebSocket server periodically sends a ping message to the consumer as a heartbeat message, the application needs to send a pong message back
You can see more detail on the RTO Python market_price_rdpgw_service_discovery.py example (the code is in Python, but the concept is the same for all languages).
I strongly suggest the client read the WebSocket API: Connect to Refinitiv Real-Time - Optimized tutorial.
There is the Article.WebSocketAPI.Javascript.QuoteWidget and Example.ERT.Javascript.ERTController JavaScript examples for RTO (and RTDS) that you can check the workflow above with JavaScript code.
- Note: the code is for demonstration purposes only, not for Production use
0
Answers
-
Hello @techlead
I am sorry to hear that you are facing those issues. Are you connecting to your local RTDS or RTO? Can you replicate the issue on demand with the WebSocket API examples?
- If you are connecting to your local RTDS: please try the examples from https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples GitHub repository
- If you are connecting to RTO: please try the examples from https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/RDP (RDP folder_ GitHub repository
About the "Sometimes there is no response from Refinitiv", the WebSocket API is a server-side API, so you may need to contact the server team to verify the issue on the server side. I highly recommend you contact the Real-Time support team from https://my.refinitiv.com/content/mytr/en/helpandsupport.html website.
2 -
Hello,
Posting on behalf of @techlead
Hi @wasin.w - client is using RTO and there is a case 12669770 open with platform support who are unable to see disconnection. the last error on the case is - "Undefined data issue was from our end. We are generating a new token every 5 seconds and after some random duration the websocket connection is not established."
Below is a snippet of the comms with support after 10-July.
Platform support:
I cross referenced your logs with our logs on the backend. But I do not see any disconnections.
Have you implemented the 4 minute refresh logic? Did it resolve the undefined data retreival?
Client:
We tried the solution specified by you, but the same issue persists. We are generating a new access token every 5 seconds then too after 8-10 minutes our connection is getting lost and we are unable to connect to websocket again. As per our discussion on call yesterday you were going to provide developer for our help any update on that?
Wasim, need your assistance and urge you to extend your support on the same topic.
0 -
Hello,
Posting on behalf of @techlead
Hi @wasin.w - client is using RTO and there is a case 12669770 open with platform support who are unable to see disconnection. the last error on the case is - "Undefined data issue was from our end. We are generating a new token every 5 seconds and after some random duration the websocket connection is not established."
Below is a snippet of the comms with support after 10-July.
Platform support:
I cross referenced your logs with our logs on the backend. But I do not see any disconnections.
Have you implemented the 4 minute refresh logic? Did it resolve the undefined data retreival?
Client:
We tried the solution specified by you, but the same issue persists. We are generating a new access token every 5 seconds then too after 8-10 minutes our connection is getting lost and we are unable to connect to websocket again.
Wasim, need your assistance on the same topic.
0
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 中文论坛