helidon icon indicating copy to clipboard operation
helidon copied to clipboard

Helidon integration with Tyrus Client would help users develop services backed by other WebSockets

Open vamshikrishna83 opened this issue 2 years ago • 5 comments

Helidon integration with Tyrus enables proper support for WebSocket server endpoints. Similarly, it would be helpful, if there is support to connect to other websocket endpoints, and consume data obtained from those.

An use-case could be like Helidon endpoint, which streams / filters / aggregates data obtained from another web-socket endpoint.

Environment Details

  • Helidon Version: 2.5.1
  • Helidon MP
  • JDK version: JDK 17
  • OS: Windows 11

vamshikrishna83 avatar Jul 15 '22 09:07 vamshikrishna83

What sort of support are you looking for? You can use the WebSocket client API as is now. Please elaborate.

spericas avatar Jul 29 '22 15:07 spericas

I tried to implement JAX-RS Web API connect to a WebSocket Client using javax.websocket-api / jakarta.websocket-api client endpoints with custom encoders / decoders for data and consume data from the same. But, i ran into blockers as i could not get even a basic example working past ClientManager.createClient() / client.connectToServer() call successfully.

If this support is already available in Helidon, then it would be nice to provide a sample / example code to educate us on how to get it working.

vamshikrishna83 avatar Aug 01 '22 11:08 vamshikrishna83

@bvkrish83 I don't understand your first sentence: JAX-RS and WebSocket are different APIs/protocols. There are several examples/tests that use the WebSocket client API in our code base (also this is a standard API that is well documented, not specific to Helidon). For example,

https://github.com/oracle/helidon/blob/helidon-2.x/webserver/tyrus/src/test/java/io/helidon/webserver/tyrus/EchoClient.java

Also when you say "ran into blockers", there's just not enough information there to provide additional help.

spericas avatar Aug 01 '22 14:08 spericas

@spericas I wanted to develop a JAX-RS API, which when executed in turn would connect to WebSocket to download / process some messages from server, and then return a response based on this processing step.

I will try to look into the sample code / classes shared by you, and then either close this issue (if it addresses all my concerns) or provide additional details / questions, if i have any - probably in couple of days time.

vamshikrishna83 avatar Aug 01 '22 14:08 vamshikrishna83

@bvkrish83 Let me know if I can close this issue

spericas avatar Aug 08 '22 20:08 spericas

@bvkrish83 Please re-open if necessary

spericas avatar Aug 10 '22 14:08 spericas