OMMMsg uniqueness

Hi,
I notice that the OMMMsg being received as part of the updates, most of then than not, seem to have same hashcode even though their attributes indicate that belong to different RICS. In my case I subscribe to a couple of RICS in the same DDS and I notice that 50-70% of the time the OMMMsg's hashcodes are the same for the updates.
OMMMsg msg = event.getMsg();
Is this an intended behavior? How do we get around this?
Thanks.
Regards,
Ganesh
Best Answer
-
Hello @ganesh.shivshankar
As you will need a deep copy for what you are doing, OMMPool.acquireCopy(OMMData) is not suitable and I suggest you use the OMMMsg.initFrom(OMMMsg) but do keep in mind that if/when you release these objects back to the OMMPool they will re-appear with the same hashCode when they are re-used.
0
Answers
-
Hi @ganesh.shivshankar. The OMMMsg above is owned (created, managed and released) by the RFA API and API can reuse the same container to pass on different messages to the application. This is done to optimize memory management - which is why you are getting same hash for multiple updates.
To distinguish between updates from different subscriptions, the app can:
- Enable (set ATTRIB_INFO_IN_UPDATES indication flag) and check Attribute Information (OMMAttribInfo) for ServiceName/Item Name combination
- Or pass on a custom object as a closure when subscribing. This object is passed back to app in the processEvent callback.
0 -
Thanks for the quick response! This is causing problems for us as we are trying to hold the incoming OMMMsgs in a queue and process the messages in a separate queue altogether (so as to not block the rfa thread as we have highly volatile RICs being subscribed to). So it results in objects being overridden one for the other. So we have resorted to do a deep copy of the OMMMsg using initFrom and put that into our queue, but we are not sure of the implications of doing this. Is this recommended?
0 -
Hello @ganesh.shivshankar
As the hashCode() method is supported for the benefit of hash tables you should note that the objects passed to the the Client interface by the API belong to the API, they will be reclaimed when the processEvent method has returned and potentially recycled by the API (The exception to this rule is the closure argument). Therefore you should not attempt to store these objects.
The closure argument is supplied by your application when you register the client and is contained in any event received as a result of registering that client interest - could this satisfy your requirement?
0 -
The closure (we have this in place already) does give us a context for the incoming message, but we have a some business logic to perform on the messages as they arrive, which is slightly processing intensive and could block the event queue thread and hence we want to defer that to a different thread. Would storing the payload (msg.getPayload()) from the message in a queue help in this case, instead of storing the entire OMMMsg object? I see that the hashcode of the payload is always different.
0 -
If you do not need the entire image you should find it more efficient to copy out the fields you require (assuming MP model) and potentially reduce the workload further by using views.
0 -
The event queue dispatch thread is owned and controlled by the user application. So RFA thread will not be blocked, when the user is processing the events.
The memory impact of holding the object in RFA event queue vs. deep copying will be same. If the application does not process messages fast enough, it will eventually run out of heap memory.
0 -
We do filter out what we need using views, but we still need to defer the parsing of the payload to a different thread, in order to avoid blocking the event queue. We use the OMM model. So would storing the payload (OMMData) work here or is that not recommended either?
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
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 279 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 716 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛