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.
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
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛