question

Upvotes
22 0 4 10

Why am I receiving a "onConnectError" even though I was able to obtain a token?

I am trying to comsume ric with RTO websocket (java). I made some improvements, but they were not sufficient, as I am still encountering the following error. For some reason, I cannot progress beyond obtaining the token. On the Fiddler side, I can only see the process up to the point where the token is retrieved. Do you have any advice for this situation? Why do I get this error but bellow code blog runs for my request.

 /**
                                 * Called when an error occurs while attempting to connect the WebSocket.
                                 */
                                public void onConnectError(WebSocket websocket, WebSocketException e)
                                {
                                    System.out.println(DateTimeStamp.getCurrentTime() + " Connect error for " + _name + ":" + e);
                                    reconnect(websocket, false);
                                }



new 11.txt


23110-1729681800661.png


Also, Are there any examples of consuming Ric using HTTP requests instead of WebSocket? What advantages does WebSocket provide in this regard? After all, I won't be continuously receiving data; I'll only connect briefly to receive data at certain times of the day. Would WebSocket or a Java example that creates an HTTP request be more advantageous for me?

#technologyema-apijavarrtorefinitiv-realtime-optimised
new-11.txt (3.5 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
24.8k 64 15 21

Hello @SelcukYAPICI,

From the logs that you have provided, I can see that your requests are being sent through the proxy server. While, your application can successfully get an authentication token, the secure websocket request is blocked. Either your proxy isn't setup to pass wss traffic, or there is a configuration issue.

I would recommend that you run your application without a debugging proxy and see if there are still connection issues.

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
22 0 4 10

Hi @Gurpreet,


As you mentioned, I commented out the code that enabled the requests to pass through the proxy. The logs that appear in the console are as attached below. As far as I can see, there hasn't been any change. What do you recommend?


new 12.txt


new-12.txt (27.6 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.

The app is still trying to connect to wss://127.0.0.1:443/WebSocket. Since you are trying to connect to RTO, you should either use service discovery, or type in the hostname of the streaming server that is enabled for your ID.

Try to use this service discovery example without modification. It should automatically discover the right streaming server to initiate wss connection.

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.