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.
0
Answers
-
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
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
- 685 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
- 252 ETA
- 556 WebSocket API
- 38 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
- 651 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 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 中文论坛