What is the best way to maintain websocket connection?
Hello,
I am trying to publish data to Elektron's websocket. Authorization token only lives for 10 minutes and when it expires, session is being closed. Before session expires I would like to start new session using refresh token. Once new session is ready my system would switch over to it and close previous session.
With this approach i am experiencing a bit inconsistent behaviour from the system. Sometimes when I issue login request for second session - first one gets closed.
I am attaching diagram of experienced behaviour.
I would appreciate any hints on how can I maintain websocket in such way so my system always have at least one active connection to publish data.
Regards,
Jan Roman
Best Answer
Answers
-
Hi Gurpeet,
Thanks for getting back. Yeah I am using Refinitiv Contributions Channel using websocket connection to your cloud instance. For now I am using preproduction environment at endpoint: wss://contrib-ws1-emea1.uat.platform.refinitiv.com/WebSocket
I am using OAuth endpoint: https://api.ppe.refinitiv.com/auth/oauth2/v1/token
Regards,
Jan
0 -
Hello @Gurpreet
I was trying this approach but it did not work for me. Please have a look on extract from logs my end. I am getting "Reauthorisation message error" when i try to extend session using refresh token.
Regards,
Jan
Dec 13, 2021 11:13:51 PM cf.idx.v3.shared.V3 log
INFO: {msg=sending message, RefinitivSession=1, messageToSend={"ID":1,"Domain":"Login","Key":{"NameType":"AuthnToken","Elements":{"ApplicationId":"MY-LOGIN","Position":"12345","AuthenticationToken":"INITIAL-AUTHORIZATION-TOKEN"}}}}
Dec 13, 2021 11:13:53 PM cf.idx.v3.shared.V3 log
INFO: {msg=processMessage, RefinitivSession=1, messageReceived=[{"ID":1,"Type":"Refresh","Domain":"Login","Key":{"Name":"MY-LOGIN","Elements":{"TRCE:MaxMessagesPerSecond":1000}},"State":{"Stream":"Open","Data":"Ok","Text":"Login accepted by host aa2bdb1c1b4b via ip-10-28-169-77.eu-west-1.compute.internal"},"ClearCache":false,"DoNotCache":true,"Private":true,"Solicited":false}]}
...
Dec 13, 2021 11:14:11 PM cf.idx.v3.shared.V3 log
INFO: {msg=processMessage, RefinitivSession=1, messageReceived=[{"Type":"Ping"}]}
Dec 13, 2021 11:14:11 PM cf.idx.v3.shared.V3 log
INFO: {msg=sending message, RefinitivSession=1, messageToSend=[{"Type":"Pong"}]}
...
Dec 13, 2021 11:15:02 PM cf.idx.v3.shared.V3 log
INFO: {msg=sending message, RefinitivSession=1, messageToSend={"ID":1,"Domain":"Login","Key":{"NameType":"AuthnToken","Elements":{"ApplicationId":"MY-LOGIN","Position":"12345","AuthenticationToken":"MY REFRESH TOKEN"}}}}
Dec 13, 2021 11:15:02 PM cf.idx.v3.shared.V3 log
INFO: {msg=processMessage, RefinitivSession=1, messageReceived=[{"ID":1,"Type":"Status","Domain":"Login","State":{"Stream":"Closed","Data":"Suspect","Code":"NotEntitled","Text":"Reauthorisation message error"},"Private":true}]}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
- 250 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
- 193 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 中文论坛