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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 0 2

Not getting rate update message from Websocket Api java example after approx 9 minutes (using git web socket example)

We are using your example code from https://github.com/thomsonreuters/websocket-api/blob/master/Applications/Examples/EDP/java/MarketPriceEdpGwAuthentication.java to consume Websocket Api , but we have noticed that application stops receiving rate update messages after aprox 9 minutes everytime, and then we have to restart application(above java example) and it again starts receiving update messages from Web Socket Api , mean time java application sends token refresh request and receives access token and keeps running for stipulated time frame .

elektron-sdktreprdp-apiwebsocketsrrto
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.

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.
Thanks, AHS

Upvotes
Accepted
426 2 4 4

Hi @deval.patil,

I just ran the same example from both ASW instance and my local server directly. Both ran fine and continued receive updates for over 30 minutes. We will need some more information to diagnose your issue:

  • Where were you running your test? from AWS or local host directly?
  • What user name you used? Does it has the format of GE-X-XXXXXXXX-X-XXX?
  • How often the app received the update? "/TRI.N" is a delayed RIC and the app should receive one update every minute.
  • Did the app receive the PING message and responded with PONG properly every 20 seconds even when there is no update messages?
  • Did the app send the token refresh request every 4 1/2 minutes (270 seconds)?

If possible, please provide the screen shot of the app when you think it stopped to receive the message.

Also, it will help if you add websock onDisconnected and onSendError event call backs in the connect instance. It will provide some more information when the websocket disconnected:

public void onDisconnected(WebSocket websocket, WebSocketFrame serverCloseFrame, WebSocketFrame clientCloseFrame, boolean closedByServer) throws JSONException {
    System.out.print("WebSocket disconnected by ");
    if (closedByServer)
          System.out.println("Server: " + serverCloseFrame.getCloseReason());
    else
          System.out.println("Client: " + clientCloseFrame.getCloseReason());
    System.exit(1);
}

public void onSendError(WebSocket websocket, WebSocketException cause, WebSocketFrame frame) throws JSONException {
    System.out.println("WebSocket Send Error:" +  cause );
    System.exit(1);
}

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
22k 58 14 21

Just finished the same test with both Java and Python examples and did not see any disconnects or interruption in data flow after 10 minutes.

Can you -

1. Confirm the hostname of EDP server where you are connecting

2. Verify that you have a direct route to internet. Some proxy servers can interrupt long running connections. To verify this, can you please try the example from a different network or home and confirm.

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
3 1 0 2

Thanks @steven.peng,@Gurpreet. for your quick reply and it was helpful.
After analyzing our current code a bit, we have noticed a change required in our logic with login . Now rates our flowing continuously.

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.