What are the advantages/disadvantages for Web Socket Json Request ID per RIC vs Request ID per mu...

...lttple Rics?
When using a web socket connection to the Refinitive API what are the advantages and disadvantages of using 1 RIC per Request ID vs using multple RICs per Request ID?
I'm referring to the following function "sendRequest(WebSocket websocket)" which makes use of the following Json string section [websocket.sendText(requestJsonString);)] which can use a single RIC per request ID or an array of RIC.
What are advantages and disadvantages of these approaches?
Best Answer
-
Hello @Nana
When you send a JSON request message with single ID and array of RICs, it is a Batch request message. You can find more detail regarding the Batch feature in Elektron WebSocket API: Make a Batch Request for Multiple Items tutorial.
The benefit of Batch request message is it lets you subscribes multiple RIC codes in a single request message.
Once the ADS receives a Batch Request, it will respond on the same ID of the Request with a Status message that acknowledges receipt of the Batch by indicating a State object with a "Data":"Ok" and "State":"Closed". Then the ADS will send each item refresh response message in separate ID (beginning with the ID of the original Batch Request message + 1). The application needs to manage subscription ID from each Refresh response message.
Example:
Request message:
"ID":2,
"Key":{
"Name":
[
'VOD.L',
'BT.L'
],
}ADS Receives a Batch request:
{
"ID":2,
"State":{
"Data":"Ok",
"Stream":"Closed",
"Text":"Processed 2 total items from Batch Request. 2 Ok."
},
"Type":"Status"
}Refresh response messages:
{
"Fields":{
"52WK_HIGH":214.6,
"52WK_LOW":133.48,
...
...
"YRLOW":133.48,
"YRLO_IND":"15M.Yr.L"
},
"ID":3,
"Key":{
"Name":"VOD.L",
"Service":"ELEKTRON_DD"
},
...
...
"Type":"Refresh"
}
{
"Fields":{
"52WK_HIGH":268.6,
"52WK_LOW":201.25,
...
...
"YRLOW":201.25,
"YRLO_IND":"15M.Yr.L"
},
"ID":4,
"Key":{
"Name":"BT.L",
"Service":"ELEKTRON_DD"
},
...0
Answers
-
Hello @Nana
In summary:
Pro:
- You can manage the mapping between the stream ID and RIC name after you have sent a request message
Cons:
- If you want to subscribe multiple items from Elektron, you need to send multiple request messages
Pro:
- You can subscribe multiple items with a single request message
Cons:
- The application needs extra process to mapping the stream ID and RIC name from the Refresh Response message instead.
0 -
Hi @Nana
In addition to everything my colleague said, there is slightly better efficiency with Batch request - saving a few bytes per RIC in the outgoing message as you don't have to repeat the 'ID', 'Key', 'Name' value labels for each RIC you request. Also, less calls to Send the Json to the server.
However, one thing to bear in mind is that there is a 64K limit on the size of a JSON message so if you are requesting several thousand RICs in a Batch request, you will need to do the additional math to ensure your JSON Request does not exceed the 64k limit - and split your request into multiple smaller batches.
Having said all that, I personally prefer Single request as I am in control of the StreamID to RIC mapping - rather than having to map later by extracting the StreamID and RIC from the Refresh message etc - unless I was to do hundreds or thousands of RICs where the reduced number of Send calls and smaller message size outweighs the mapping effort (IMHO).
0 -
Guys,
Thank you for your responses they were very helpful. This got me the information I needed.
Regards
0
Categories
- All Categories
- 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
- 613 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
- 248 ETA
- 552 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
- 629 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
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛