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.

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.