For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Getting NPE during consumer initialization for Elektron

The Refinitiv Elektron API throws an NPE error when the scheduler is stopped for the weekend.

Consumer created :


ommConsumers = new OmmConsumer[4];

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();

ommConsumers[threadId] =EmaFactory.createOmmConsumer(config.host(ReutersConfiguration.getHost()).username(ReutersConfiguration.getUserId()));

ElementList batch = EmaFactory.createElementList();

OmmArray array = EmaFactory.createOmmArray();

instrumentDefinitionsForThread.forEach(currency -> {

array.add(EmaFactory.createOmmArrayEntry().ascii(currency.getReutersSymbol()));

});

batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));

registeredClients[threadId] = new ReutersListenerAndProcessor(threadId, instrumentDefinitionsForThread);

ommConsumers[threadId].registerClient(EmaFactory.createReqMsg().serviceName(SCHEMA_NAME).payload(batch), registeredClients[threadId]);


Consumer cleanup:

IntStream.range(0, 4).filter(i -> ommConsumers[i] !=null)

.forEach(i->{ try{

ommConsumers[i].uninitialize();

} catch (Exception e) {

LOGGER.log(Level.WARNING,e);

}

});



NPE as result when cleanup is called:


com.thomsonreuters.ema.access.OmmConsumerImpl pool-2-thread-1 WARNING: loggerMsg\n ClientName: ChannelDictionary\n Severity: Warning\n Text: RDMDictionary stream was closed with status message\n streamId 3\n Reason State: Closed/Suspect/None - text: "channel down."\nloggerMsgEnd\n\n


Aug 20 17:26:22 119427 172622.476000 2970 com.thomsonreuters.ema.access.OmmConsumerImpl pool-2-thread-1 WARNING: loggerMsg\n ClientName: ChannelDictionary\n Severity: Warning\n Text: RDMDictionary stream was closed with status message\n streamId 4\n Reason State: Closed/Suspect/None - text: "channel down."\nloggerMsgEnd\n\n

119427 172632.817227 2972 Exception in thread "pool-10-thread-1" java.lang.NullPointerException

119427 172632.817319 2973 at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(OmmBaseImpl.java:986)

119427 172632.817360 2974 at com.thomsonreuters.ema.access.OmmBaseImpl.run(OmmBaseImpl.java:1131)

119427 172632.817388 2975 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

119427 172632.817406 2976 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

119427 172632.817421 2977 at java.lang.Thread.run(Thread.java:748)


elektronrefinitiv-realtimeelektron-sdk
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Client has submitted this question to RDC; case# 09110491

@cnxuser

Thank you for your participation in the forum. Has the solution provided by Refinitiv Support to upgrade EMA to version 3.5.1.0 resolved the issue you experienced? If yes, could you please accept the answer provided on this thread? This would help other users who may experience similar issue in the future. And if upgrading the version of EMA did not address the problem, could you update this thread with any observations or findings you've had since the upgrade?

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.
Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
9.6k 10 7 7

The solution from the ticket client submitted to the support team:

After the client upgraded EMA to version 3.5.1.0 shipped with Elektron SDK(Real-Time SDK) package 1.5.1.L1, the problem has not happened.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.