Unfolding RIC chain via JET Api
Hello, What is the best way to unfold RIC chains for HTML5/js app? From documentation I learned that it's possible to pass chain to JET Quotes object and it works still there are several problems: - It's impossible to pass more than one chain to Quotes object. Obvious method chaining like `JET.Quotes.quoteSubscription.chain(chains[0]).chain(chains[1]).chain(chains[2])` results in only last chain being passed to Quote object. - Actually it won't unfold the chain, it will start to stream the requested fields, that is why you always need to request at least one field. Of course I can request some reference field like X_RIC_NAME, but it's superfluous - Due to the streaming nature of Quote object, it's impossible to understand number of rics in the chain and so one cannot simply stop the quote subscription after all rics are recieved. The only way to cope with it is to utilize something like window.setTimout method to check in no new data was recieved after the request or something like this These problems lead to an ugly solution for such a simple task as to unfold several chains. Something like this (using linq.js): var resultedrics = [], chainsloaded = 0, chainLoadedHandler = function() { console.debug("All chains loaded"); Enumerable.From(resultedrics).ForEach(function(el) { console.debug(el); }); }, unfoldChains = function(chains) { var unfoldChain = function(chain) { var timeout = false, quoteSubscription, stopChainLoading = function() { quoteSubscription.stop(); console.debug(chain + " loaded"); chainsloaded++; if (chainsloaded === chains.length) { chainLoadedHandler(); } }, quoteSubscriptionHandler = function(subscription, ric, updatedValues) { if (resultedrics.indexOf(ric) === -1) { resultedrics.push(ric); if (timeout) { window.clearTimeout(timeout); timeout = false; } timeout = window.setTimeout(stopChainLoading, 1000); } }; quoteSubscription = JET.Quotes.create(), quoteSubscription.chain(chain) .rawFields(['X_RIC_NAME']) .onUpdate(quoteSubscriptionHandler) .start(); }; Enumerable.From(chains).ForEach(unfoldChain); }; This solution works and works quite fast, still I wonder if there's more clean method to do it. It's possible to unfold several chains in one request via ADC though, but I still have hope to use dedicated JET API for this task. Please advise me if you know a better method. Thank you in advance,
Ivan
Ivan
Tagged:
1
Answers
-
I don't think the `JET.Quote` is designed for this type of task. For me, I would go with the ADC solution.0
-
Unfortunately, for some reason ADC didn't like the chains I wanted to unfold So currently I probably have to stick to JET while investigating the problem with ADC0
-
JET doesn't allow multiple chain RICs in one subscription. If you have multiple chain RICS you will need to have multiple subscriptions. You can use the DataTable that is in the Novakit for managing the data for multiple rics and and fields
https://eegitemea.int.thomsonreuters.com/upg_strategic_development/novakit3/wikis/home There is no particular condition which you can use to stop the subscription because these are all real time fields. For example the 'X_RIC_Name' field for a chain may change if a new RIC is added to it. So i guess either time it out or leave it open to manage any changes.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 中文论坛