question

Upvotes
Accepted
25 6 5 11

consumer.registerClient

Is it ok to call consumer.registerClient() with batch inputs and also multiple registerClient() for individual rics.

Currently when I call consumer.uninitialize() after everything is processed, the job hangs at the call of consumer uninitialize() and stays like that forever.

Can you please advise?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-api
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.

@sagar.s

Hi,

Please let us know if you have any update on this question.

If it is still an issue, please post again to offer further insight into your question.

Regards,

AHS

I was able to reproduce the error using an example code. I used the consumer series102 snapshot code. I subscribed to 5 rics as a batch and ran it every 5secs. The example code got stuck at 5:30 pm. In order to reproduce the issue, the server has to be very busy.

@sagar.s

Do you have a chance to try the latest version of EMA? if you have any update on this question.

sagar.s avatar image   sagar.s veerapath.rungruengrayubkul

There was no issue so far with the version

Elektron-SDK_1.2.0.2.G1. It seems to have fixed the issue.

Upvotes
Accepted
361 1 4 3

@sagar.s,

That callstack looks very similar to an issue that was recently fixed. The fix is available on GitHub under the tag Elektron-SDK_1.2.0.2.G1, and is available in Maven Central (version 3.2.0.2). Would you be able to upgrade to this release?

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.

Upvotes
136 3 3 3

Hi,

could you please provide the jstack (thread dump) of your process when it hangs in the consumer.uninitialize() method call?

Thanks,
Michal

$JAVA_HOME/bin/jstack <process_id> 
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.

Upvotes
25 6 5 11

Please find the attached thread dump.

test-thread-print1.txt


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.

Upvotes
25 6 5 11

Any updates on this ?

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.

Upvotes
32.2k 40 11 20

Hello @sagar.s,

There is no issue to register batch and multiple single requests. It is straightforward to verify on your side. I took example 370, MarketPrice Batch, that came with SDK, and after batch request, introdruced single requests for the same instruments (the duplicates are tested on purpose, as I think it is part of yoru question), the resulting code looking like this:

...
OmmArray array = EmaFactory.createOmmArray();
			
array.add(EmaFactory.createOmmArrayEntry().ascii("TRI.N"));
array.add(EmaFactory.createOmmArrayEntry().ascii("IBM.N"));

batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));
			
consumer.registerClient(EmaFactory.createReqMsg().serviceName("ELEKTRON_EDGE").payload(batch), appClient);
			
ReqMsg reqMsg = EmaFactory.createReqMsg();
consumer.registerClient(reqMsg.serviceName("ELEKTRON_EDGE").name("IBM.N"), appClient);
consumer.registerClient(reqMsg.serviceName("ELEKTRON_EDGE").name("IBM.N"), appClient);
consumer.registerClient(reqMsg.serviceName("ELEKTRON_EDGE").name("TRI.N"), appClient);

Thread.sleep(60000);			// API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()

...

Please observe that there is no issue when the example uninitializes after 60 seconds, all the 5 items requests are closed:

Item Name: TRI.N
Service Name: ELEKTRON_EDGE
Item State: Closed / Suspect / None / 'Login stream was closed.'

Item Name: TRI.N
Service Name: ELEKTRON_EDGE
Item State: Closed / Suspect / None / 'Login stream was closed.'

Item Name: IBM.N
Service Name: ELEKTRON_EDGE
Item State: Closed / Suspect / None / 'Login stream was closed.'

Item Name: IBM.N
Service Name: ELEKTRON_EDGE
Item State: Closed / Suspect / None / 'Login stream was closed.'

Item Name: IBM.N
Service Name: ELEKTRON_EDGE
Item State: Closed / Suspect / None / 'Login stream was closed.'

Therefore, I believe the issue that causes the hang is elsewhere in your application, threading and synchronization design can be challenging. If you see hang on unintialization I would look into threading and synchronization.

If you find that you are unable to zero in on the exact issue you are facing by "dressing down" your app code, and that you need someone to take a detailed look at the code, and your organization is a TRDC member, your option is creating a TRDC inquiry, attaching your custom code, and getting time-sensitive in-depth help on your code.

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.

Upvotes
25 6 5 11

@zoya.farberov/ @jim.carroll

Lets say I have registered to 200 RICs using batch and also by individual RIC. So when I call consumer.uninitialize(), should I receive a msg for ALL 200 RIC saying the RIC state is closed everytime?

Eg:

Item Name: TRI.N Service Name: ELEKTRON_EDGE Item State: Closed / Suspect / None / 'Login stream was closed.'

@jim.carroll

Can you please provide more info on the callstack issue such as root cause or any other info if you are aware?

Thanks,

Sagar

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.

Upvotes
32.2k 40 11 20

Hi @sagar.s,

Yes, you should see them if you log everything as in the example,

.However, we suggest that:

  • An application unregisters any item interest that is not required anymore via unregister call
  • Logging level is chosen appropriately for the app to be efficient
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.

Upvotes
25 6 5 11

@jim.carroll

I do not see RIC state closed after I call uninitialize(). I only see the folllowing:

May 31, 2018 5:07:30 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
May 31, 2018 5:07:30 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
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.

Upvotes
25 6 5 11

FYI... I'm using the 1.1.E1 version of EMA

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.

Hello @sagar.s ,

Were you able to upgrade to the latest version 1.2 as suggested by Jim?

I have tested with Elektron-SDK1.1.0.java.rrg, it is a general release version of 1.1, not the latest, "E" stands for "early release".

Were you able to run modified Batch example, did you see the expected number of "item close"?

Hi @zoya.farberov

1. I have requested for upgrade to new version.

2. I ran the modified batch call, still I do not see the items close. Is there any setting that needs to be added in EmaConfig.xml?

Hi @sagar.s ,

No special settings should be necessary. If you run MarketPrice example 100 unmodified, till it exists, do you see in your output, toward the end:

StatusMsg

streamId="5"

domain="MarketPrice Domain"

state="Closed / Suspect / None / 'Login stream was closed.'"

name="IBM.N"

serviceId="300"

serviceName="ELEKTRON_EDGE"

StatusMsgEnd

Show more comments
Upvotes
25 6 5 11

@zoya.farberov

I was able to reproduce the error using an example code. I used the consumer series102 snapshot code. I subscribed to 5 rics as a batch and ran it every 5secs. The example code got stuck at 5:30 pm. In order to reproduce the issue, the server has to be very busy.

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.

Upvotes
32.2k 40 11 20

Hello @sagar.s,

Please attach the complete modified example, I will run it and try to reproduce the issue you are seeing on my side.

If reproduced, I will file the issue with Elektron API product team, it will be prioritized and resolved.

Use the little "paper clip" tool on top of the answer entry window to attach it.

Thanks

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.

Upvotes
25 6 5 11

consumer.zip

@zoya.farberov

Please find the attached zip file containing Consumer.java modified example code.

I have redacted the server config,user and service name. Please add it accordingly.

Linux server version is RHEL 6.7

Thanks,

Sagar


consumer.zip (1.2 KiB)
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.

@sagar.s,

Received.

Just to confirm, you are testing with EMA 1.2 now?

@sagar.s,

Does uninitialize hang consistently for you with this example?

or under what conditions?

I run the example several times so far and was not able to reproduce the hang on unitialize.

Not every job hangs. It hangs when the server is busy. I usually see around 5-6 jobs hanging everyday

Yes... EMA 1.2

@sagar.s

Please provide several Java call stacks of all threads when the application hangs. I would like to verify if it is deadlock.

@zoya.farberov @sagar.s

Hello, I'd like to add related info regarding this issue. Currently, EMAJ 1.2.0 (or below) may encounter a stuck problem when an OMMConsumer.uninitialize() method is called. This is similar to a deadlock problem, but it is not.

To elaborate on this problem, when the application calls that method, it holds a lock object and waits (TIMED_WAITING) for a Worker thread pool termination condition. However, the thread pool (EMA thread) waits for the lock object and entered to WAITING state.

Now, I'm checking whether the resolution has been released on GitHub already or not.

@sagar.s Anyway, if you can obtain the thread dump when the application encounters this issue, please attach it to me for analysis whether this is the same issue or not.

So, I recommend you capture a thread dump from the following command:

// List all Java processes
$jps

// Get the Java Stack Trace / Thread Dump
$jstack -l <processId>

Note that you can redirect a result from jstack to a file using a right angle bracket character. For example:

$jstack -l 9608 > c:\Users\u0154418\Desktop\test_jstack.txt

Hope this helps.

sagar.s avatar image sagar.s Nipat Kunvutipongsak

threadprint-20180613.txt

@Nipat Kunvutipongsak / @zoya.farberov / @jim.carroll /

@jirapongse.phuriphanvichai

Please find the requested info:

jps
26778 Jps
22540 Consumer


jcmd -l 22540
27018 sun.tools.jcmd.JCmd -l 22540
22540 com.thomsonreuters.ema.examples.training.consumer.series100.example102__MarketPrice__Snapshot.Consumer

jcmd 22540 Thread.print > Thread.print_20180613.txt
ps -efL | grep -i consumer > process_list.txt

@Nipat Kunvutipongsak,

Yes, the fix for the issue you describe was released on GitHub in tag Elektron-SDK_1.2.0.2.G1. I believe it to be the same issue as the one in this question, based on a thread dump that was provided earlier in the comments.

@jim.carroll /

@Nipat Kunvutipongsak,

Is the version

released on GitHub in tag Elektron-SDK_1.2.0.2.G1

is same as ESDK SDK - Java - 1.2.0 67.44 MB 04/27/2018 17:26 in

https://developers.thomsonreuters.com/elektron/elektron-sdk-java/downloads link ? If not, can it be made available in above link?

Show more comments
Upvotes
25 6 5 11

@zoya.farberov

Any eta for the next general release?

We are only allowed to download from the link

https://developers.thomsonreuters.com/elektron/elektron-sdk-java/downloads

Please provide the sendthisfile link as well. I'll check if its allowed for download.

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.

Upvotes
32.2k 40 11 20

Hello @sagar.s,

There is no ETA for the next release. And version 1.2 is quite recent. However, if you are watching Elektron Java API on developers portal (have registered to watch it via clicking "add to my watchlist" link displayed at the top of the API) you will be personally notified of any updates to the watched API via email.

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.

@sagar.s

Please confirm via comment when you have received sendthisfile download link, or if you don't receive it within an hour from now, also let us know, will will try to get it to you another way.

Upvotes
25 6 5 11

@zoya.farberov

I was unable to access the link. Please let me know if there is any other secure way to download latest version.

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.

@sagar.s

I just sent you a dropbox link.

If that is also blocked, the next step can be your TR account team. They will be able to help, bring it over on their next visit, but this approach will take time.

Or if you are able to download tonight and bring securely tomorrow, this can work too, Elektron SDK is available on GitHub via registering.

Upvotes
1 0 0 1

Hi,

the latest release is also available from Maven Central. Here is the link: https://search.maven.org/#artifactdetails%7Ccom.thomsonreuters.ema%7Cema%7C3.2.0.2%7Cjar

Direct link to the jar file location:

http://repo1.maven.org/maven2/com/thomsonreuters/ema/ema/3.2.0.2/

Hope this helps.

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.

Upvotes
25 6 5 11

@zoya.farberov

Can you please send the sendthisfile link(previously sent) which does not expire?

Thanks,

Sagar

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.

Hello @sagar.s ,

Sendthisfile link can not be unlimited, it is valid for the maximum of 4 days.

I will resend it to you.

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.