Problem while uninitializing the ommconsumer

sagar.s
sagar.s Explorer

Hi Team,

I'm getting concurrent modification exception issue when trying to close the ommcomsumer. Can you please take a look at the issue? Is it a known issue in the api?

Nov 20, 2017 5:11:54 PM com.thomsonreuters.ema.access.ChannelDictionary processCallback
WARNING: loggerMsg
ClientName: ChannelDictionary
Severity: Warning
Text: RDMDictionary stream was closed with status message
streamId 3
Reason State: Closed/Suspect/None - text: "Login stream was closed."
loggerMsgEnd
Nov 20, 2017 5:11:54 PM com.thomsonreuters.ema.access.ChannelDictionary processCallback

WARNING: loggerMsg
ClientName: ChannelDictionary
Severity: Warning
Text: RDMDictionary stream was closed with status message
streamId 4
Reason State: Closed/Suspect/None - text: "Login stream was closed."
loggerMsgEnd

Exception in thread "main" java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.remove(HashMap.java:1451)
at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(Unknown Source)
at com.thomsonreuters.ema.access.OmmBaseImpl.uninitialize(Unknown Source)

Best Answer

  • Michal Frajt
    Michal Frajt Explorer
    Answer ✓

    Note that the OMMConsumer.uninitialize() method call will very likely fail if there are many items still registered receiving updates. Unregistering all items, waiting a bit, calling OMMConsumer.uninitialize() might mitigate the risk of failure, but still you might hit the moment when the dispatch thread is processing some heartbeat or info messages and get into the same CME error.
    The OMMBaseConsumer synchronization model between caller threads and dispatch thread is wrong or rather not existing at all causing CME and other errors being thrown randomly (more you use it, more error situations you get).

Answers