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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 2 5

Websocket API and Java

Hi all,
could someone please answer me if it is possible to use Websocket API with JAVA?

I have seen it here: https://developers.refinitiv.com/en/article-catalog/article/choosing-your-refinitiv-realtime-streaming-api that Websocket API is compatible with .NET, Python, and Typescript.

Many thanks for considering my request.

websocketsjavasupport
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
Accepted
25.3k 87 12 25

Hi @anton.skripin

You can use the Websocket API with Java - If you refer to the tutorials, they mention how you can use any programming language that supports Websockets: Tutorials | Refinitiv Developers

The Websocket API is not an API or SDK in the commonly understood sense - i.e. there are no Refinitiv specific libraries or DLLs etc to download. If you refer to the Downloads section or the GitHub page you will find Sample source code and Documentation only.

In theory, you can use any programming language that supports Websocket connectivity and JSON encoding/decoding to develop an application utilising this Websocket API....

You will need a programming language that supports Websocket creation – intrinsically or through external packages. We provide a few basic examples for C#, Go, Java, Node.js, Perl, Python, R, Ruby – as well as Android and Swift (iOS) specific examples.

You can find some Java examples on our Github repository:

websocket-api/Applications/Examples/RDP/java at master · Refinitiv/websocket-api · GitHub

websocket-api/Applications/Examples/java at master · Refinitiv/websocket-api · GitHub

However, as pointed out by my colleague @Shadab Hussain - we do recommend you use the RT-SDK if using Java to consume data via Websockets. One benefit of using RT-SDK Java is that the RT-SDK can take care of various overheads of session management, recovery etc - which would have to implement yourself if using the Websocket 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.

@umer.nalla @Shadab Hussain thank you for your comprehensive replies. I have been looking through different available APIs for financial data retrieval and I have a couple of more questions:


1) RT-SDK for Java can be considered as a wrapper for WebSocket API? If it is the case, then is it a similar library to Refinitiv Data (RD) Library which is available for Python and serves as a wrapper for WebSocket API as well?

2) Do I understand correctly that RT-SDK and RFA Java are using different concepts of retrieving data - i.e. RT-SDK utilizes web sockets whereas RFA Java uses a publish-subscribe mechanism?

Thank you one more time for your time and consideration.

Best regards,
Anton

Upvotes
884 4 2 8

Hi @anton.skripin,

Please find the Overview & Quickstart page of the Real-Time SDK Java version here. Also, you can download SDK from here and go through EMA/ETA tutorials.


Let me know if it's helpful and have any more questions.

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.

Upvote
25.3k 87 12 25

Hi @anton.skripin

RT-SDK is our strategic SDK - consisting of the lower level ETA (highest possible performance) and EMA (higher level ease of use wrapper around ETA - still with very high performance)

RT-SDK can consume data using our binary Refinitiv Wire Format as well as Websocket transport.

RFA can also consume data using RWF or the legacy string-based MarketFeed format. RFA is a feature-complete (legacy) API and will not receive any future enhancements etc. We strongly advise against any new developments using RFA.

if for some reason you don't wish to use RT-SDK, then you can use the RD Library in Python or .Net to consume streaming websocket Data as well. However, note that these will not deliver anywhere near the same performance level as RT-SDK (be it EMA or ETA).


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.

Hi @umer.nalla

thank you for your answer one more time.

I was reading the documentation for the RT-SDK for Java and in the API concept guide (can be found here: https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java/documentation#api-concepts-guide). It is outlined there that Websocket functionality is only supported in the C / C++ version of the software

Therefore, I assume that RT-SDK for Java is able to consume data using only the Refinitiv Wire Format. Could you please correct me if I am mistaken here in my understanding?

Regards,
Anton

Hello @anton.skripin

According to the https://github.com/Refinitiv/Real-Time-SDK/blob/Real-Time-SDK-2.0.5.L1/Java/CHANGELOG.md file, the RTSDK Java edition supports the WebSocket connection.

The example for the WebSocket connection is EMA Java ex180_MP_Websocket.

Hope this helps.

Hi @anton.skripin


As per my colleague's reply, the API concepts guide appears to be outdated and I have reported this to the RT-SDK team - so hopefully, this will be corrected in a future release.

Apologies for the confusion.

Upvote
25.3k 87 12 25

Hi @anton.skripin

One other point to add is that the RD Libraries are still in the Beta phase - not sure about a final release data.

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.