question

Upvotes
35 7 10 12

when we will get the error as "Login stream was closed" in Elektron EMA API

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apilog-in
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
9.6k 10 7 7

Hello @Chaitanya.Vishnubhotla

The login stream can be closed if a login user is invalid e.g. there is no the user in the System as example shown below:

The user named Jack is not found in the System so the login stream is closed. To get the valid login user, you should contact Thomson Reuters Account team.


unknownuser.png (20.0 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.

Upvotes
35 7 10 12

Hi @Pimchaya.Wongrukun

We are getting a weird behavior as below

i.e., for RHK provider for one RIC code /0489.HK, when we run the Elektron EMA API, we are getting the above

no| 170627| 0352209| RHK| /0489.HK| Login stream was closed.|
no| 170627| 0352209| RHK| /0489.HK| Service not available.|
yes| 170627| 0352209| RHK| /0489.HK| 3.55| 3.5| 3.51| 3.52| 3.57| 3908900.0| 27 JUN 2017| 3.6| 3.49| 0|

One time it is saying as Login stream was closed

Other time it is saying as Service not available

Some other time It is giving us the required data,

Can you please let us know what might be the reason?

Note : Let's say if we have a 1000 RIC codes, this strange behavior is with one or two code randomly.rest all of them are giving data perfectly.

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
26.3k 60 17 14

Hi @Chaitanya.Vishnubhotla

Can you give us the RSSL trace file when the problem occurs? You can enable the trace in EMA Java application by setting XmlTraceToStdout Consumer entry parameter to 1 in EmaConfig.xml located in the application’s run directory. For example:

<Consumer>
  <Name value="Consumer_1"/>
  ...
  <XmlTraceToStdout value="1"/>
</Consumer>

Then, EMA traces its received and sent messages in XML format to stdout/console.
The xml trace log can be long so please redirect your application command output to a file as the syntax below:
Java_command_line_runing_your_application > output_file_name
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
35 7 10 12

cuserscvishnudesktopreutersconfig.zip

Hi @Wasin Waeosri

We have runned and made the output to redirect to a file. Please find the attached file.

We have received the status error as "Login stream was closed" response for the RIC code /0762.HK for RHK provider.

Please help us with the problem.


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
26.3k 60 17 14

Hi @Chaitanya.Vishnubhotla

I have checked the given RSSL trace file and I found the following interested points

  1. The application requests for snapshot (non-streaming) view data
  2. The Application seems to set a lifetime to dispatch incoming data from the API for 15 seconds
  3. The API does not receive /0762.HK data from the backend until it reach the API request timeout
  4. When it reaches 30 seconds, the application uninitializes the OMMConsumer object which makes the API sends a close request message for the Login stream. The remaining streams will receive "Item State: Closed / Suspect / None / 'Login stream was closed.'" status because the API just closed the login stream

I have tested with the EMA Java Consumer Example 100, the example shows "Item State: Closed / Suspect / None / 'Login stream was closed.'" for the remaining item stream when it calls consumer.uninitialize() function.

To confirms my assumption, please give me the following information:

  • The Application log messages/files that generated the same time as the given 859-cuserscvishnudesktopreutersconfig.zip file
  • The EMA Java version that encounters the problem
  • Your EMA Configuration file
  • The code that call Thread.sleep(<time value>) or call OMMConsumer.dispatch function. It will let me check the application dispatch lifetime.

Please see my full investigation detail below

### First /0762.HK request ###

The application sends two request messages for the /0762.HK items. The stream id 55 and 1155. The first stream id 55 was requested on 08:03:19, then the API closed this stream on 08:03:34 without receives any data from the TREP infrastructure.

<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/10.65.88.56:47644 remote=rcotrep02/10.65.78.42:14002] -->
<!-- Tue Jun 27 08:03:19 EDT 2017 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REQUEST domainType="MARKET_PRICE" streamId="55" containerType="ELEMENT_LIST" flags="0x442 (HAS_PRIORITY|HAS_QOS|HAS_VIEW)" Qos: Realtime/TickByTick/Static - timeInfo: 0 - rateInfo: 0 priorityClass="1" priorityCount="1" dataSize="54">
    <key flags="0x03 (HAS_SERVICE_ID|HAS_NAME)" serviceId="256" name="/0762.HK"/>
...
<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/10.65.88.56:47644 remote=rcotrep02/10.65.78.42:14002] -->
<!-- Tue Jun 27 08:03:34 EDT 2017 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<CLOSE domainType="MARKET_PRICE" streamId="55" containerType="NO_DATA" flags="0x00" dataSize="0">
    <dataBody>
    </dataBody>
</CLOSE>

This stream process takes 15 seconds, which is the default API item request timeout (EmaConfig.xml's RequestTimeout). It shows that the API does not receive /0762.HK data from the backend until the API reaches item request timeout limit. To confirm my assumption, is there any "Request Timeout" status or log messages?

### Second /0762.HK request ###

The application sends the second /0762.HK (stream id 1155) on 08:03:34, which is 15 seconds after the API connects to the TREP.

<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/10.65.88.56:47644 remote=rcotrep02/10.65.78.42:14002] -->
<!-- Tue Jun 27 08:03:16 EDT 2017 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REQUEST domainType="LOGIN" streamId="1" containerType="NO_DATA" flags="0x04 (STREAMING)" dataSize="0">
...
<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/10.65.88.56:47644 remote=rcotrep02/10.65.78.42:14002] -->
<!-- Tue Jun 27 08:03:34 EDT 2017 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<REQUEST domainType="MARKET_PRICE" streamId="1155" containerType="ELEMENT_LIST" flags="0x442 (HAS_PRIORITY|HAS_QOS|HAS_VIEW)" Qos: Realtime/TickByTick/Static - timeInfo: 0 - rateInfo: 0 priorityClass="1" priorityCount="1" dataSize="54">
    <key flags="0x03 (HAS_SERVICE_ID|HAS_NAME)" serviceId="256" name="/0762.HK"/>
...
<!-- Outgoing Reactor message -->
<!-- java.nio.channels.SocketChannel[connected local=/10.65.88.56:47644 remote=rcotrep02/10.65.78.42:14002] -->
<!-- Tue Jun 27 08:03:34 EDT 2017 -->
<!-- rwfMajorVer="14" rwfMinorVer="1" -->
<CLOSE domainType="LOGIN" streamId="1" containerType="NO_DATA" flags="0x00" dataSize="0"> <--- The application calls consumer.uninitialize(); statement
    <dataBody>
    </dataBody>
</CLOSE>


//<--- The "Item State: Closed / Suspect / None / 'Login stream was closed.'" status message for /0762.HK should be printed during this time
...

The above log messages mean the application reach a lifetime 15 seconds for dispatching incoming data, so it calls consumer.uninitialize(); statement to close a connection by closing the Login stream. But the newly request /0762.HK does not receive data from the TREP yet, so the item stream is remaining alive and gets "Login stream was closed." message.

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
35 7 10 12

cuserscvishnudesktopemaconfig.zip

Hi @Wasin Waeosri

I don't have the log file for that particular run of request, but I can provide the remaining things which you have asked.

Java Version: Elektron-SDK1.1.0.java_0
Dispatch method: consumer.dispatch(10);

Config file: Attached above.

Thanks

Chaitanya V V R V


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
26.3k 60 17 14

Hi @Chaitanya.Vishnubhotla

I will check the given config file, could you please give me application source code and the code that controls the consumer.dispatch statement? I want to check the lifetime of the application.

example:

while (startTime + 60000 > System.currentTimeMillis())
   consumer.dispatch(10);
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
35 7 10 12

Hi @Wasim Waeosri

FYI:

The controlling code will be as follows

while (appClient.getStatus(true)){

consumer.dispatch(10); // calls to onRefreshMsg(), onUpdateMsg(), or onStatusMsg() execute on this thread

}

where the getStatus method will return true until all the RIC codes are processed by Elektron API, once done it will return false.

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
26.3k 60 17 14

Update: The client confirms the error has occurred due to circuit level problems with the Servers. The client's infrastructure team suggest the application switch back to the old server.

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.