Unconditional Consumer API or stops when no msgs to consume?
Please clarify with below code snippet, when the consumer stops consuming the data from ADS? The reason for this question would be, it consumes the market data continuously when I comment out the finally block below but stops consuming when there is a finally block. I understand the use of finally here but on the other side is what I'm trying to. Does consumer stops whenever there is no update message or there is any configuration concept to understand behind it? On what time out basis does consumer continue to consume the data when there is no finally block? Any lights on this would be great to understand better.
batch.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, view_data_array));
consumer.registerClient(EmaFactory.createReqMsg().serviceName("FINANCE_PRICES").payload(batch), appClient);
Thread.sleep(60000); // API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()
} catch (InterruptedException | OmmException excp) // views last_traded limit the consumer resp
{
LOG.info(excp.getMessage());
} finally {
if (consumer != null) consumer.uninitialize();
}
Best Answer
-
Thank you for reaching out to us.
After the consumer can connect and login to the server, the consumer will maintain a connection to the server. As long as the connection is alive, the API can consume data from the server.
To stop consuming data from the application, the application needs to cut the connection by uninitializing the consumer or exiting the application.
2
Answers
-
Ok, Thank you. If we don't uninitialise the consumer forever, say I commented out the finally block, is there any time limitation for the provider quit due to over usage? If no, what's the concept it works behind? What architecture does this work behind? Curious to know about that ever running thread.
Also, I remember read some where around the EMA is not thread safe! So, what kind of multi thread safety code should I make while consuming from EMA? Any thoughts on this may help here.0 -
It is similar to file handling in an application.
As long as a file is opened, an application can read and write from/to that file. Finally, an application needs to close a file to release the resouces and free the memory. This also covers socket programming.
consumer.uninitialize() is used to close the connection, release the resources, and free the memory.
Regarding the thread safety, as far as I know, EMA is thread safe. Please let me which document that mentions that EMA is not thread safe. I will contact the product team to verify it.
0 -
It was documented in one of my internal portal. Would you bother referring me the right document to ensure EMA thread safe and it will be awesome to read?
0 -
It was mentioned in the ETA developer guide in section 2.3 Performance and Feature Comparison.
Please also update the document in the internal portal to avoid any further confusions.
0 -
The behavior you're experiencing is tied to the MapQuest Route Planner cleanup action in the finally block.
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 中文论坛