question

Upvotes
Accepted
39 1 0 5

Submission via Java EMA suddenly runs slowly

So I submit data via the Java EMA (based on the Contributor.java example code). Everything is fine for a number of days (submitting 295 items that takes 15ms every second), but then suddenly it will start to run very slowly with the same batches taking between 3000ms and 7000ms. Some times this rectifies itself, but a lot of the time it doesn't. There are no error messages or issues reported, just a drastic slowdown.

All this can be sorted out by a simple restart of the code, so what I am wondering is: Is there a way to reset the connection so it starts again programatically?

#technologyema-apijava
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
78.6k 248 52 74

@JasonS

Thanks for reaching out to us.

Something in the application code or API may be wrong.

To investigate this kind of issue, I typically use a Java profiling tool to monitor the Java process.

However, if you are a Refinitiv Developer Connect (RDC) named user, you can submit this issue to the API support team via Contact Premium Support to investigate this issue.

To reset the connection, you can destroy the current OmmConsumer and create a new one.




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.

So if I have a method such as the one below, could I call this to reset the OmmConsumer?


public void startTunnelStream() {
if (ommConsumerCreateTime < System.currentTimeMillis() - 60 * 1000) {
isRunning.set(false);

if (tsc != null) {
tsc.close(); // this calls the .clear() on the TunnelStream
tsc = null;
}

// Now load the Refinitiv libraries
final RefinitivConfig login = config.getRefinitivConfig("Primary");
tsc = new TunnelStreamClient(this, login.getUsername(), login.getPassword(), "DDS_TRCE", "");

if (ommConsumer != null) {
log.info("Deleting old OmmConsumer");
ommConsumer.uninitialize();
ommConsumer = null;
}

log.info("Creating OmmConsumer");

ommConsumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig());
tsc.setOmmConsumer(ommConsumer);

LoginReq loginReq = EmaFactory.Domain.createLoginReq();
long loginHandle = ommConsumer.registerClient(loginReq.message(), this);

ReqMsg reqMsg = EmaFactory.createReqMsg();
ommConsumer.registerClient(reqMsg.domainType(EmaRdm.MMT_DIRECTORY).serviceName("DDS_TRCE"), this);

ommConsumerCreateTime = System.currentTimeMillis();
}
}


@JasonS

According to the code, yes, it creates a new OmmConsumer.


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.