springwolf-core icon indicating copy to clipboard operation
springwolf-core copied to clipboard

Create springwolf-websockets-example

Open stavshamir opened this issue 2 years ago • 3 comments

  • Create a new submodule springwolf-websockets-example in springwolf-examples. The submodule project structure should be similar to the other example project.
  • The project should have a working docker compose setup that would allow us to conveniently test the plugin after we implement it.
  • We may skip creating the expected asyncapi.json file at this point.
  • As the plugin is not implemented yet, the project should not include it at this point and only provide a working Spring Boot websockets project.

stavshamir avatar Sep 19 '23 07:09 stavshamir

Relates to https://github.com/springwolf/springwolf-core/issues/364, https://github.com/springwolf/springwolf-core/issues/61

timonback avatar Sep 25 '23 09:09 timonback

From an earlier project, I do have some example code.

But I also stumple upon websockets, which I had used together with Reactor Flux to publish data from the server and STOMP to communicate bidirectional over websocket.

The annotations listed in https://github.com/springwolf/springwolf-core/issues/24#issuecomment-1118869912 are also the ones I am aware of. Each @MessageMapping would correspond to an incoming channel without a response. Each @SendTo and @SendToUser would correspond to an outgoing channel. Both from the view of the application.

User -> Request -@MessageMapping-> application -@SendTo-> Response -> User

Both AsyncAPI bindings either provide 0 or a couple parameters to describe the initial connection string and there is currently no activity: https://github.com/asyncapi/spec/issues/787

I suggest to go with STOMP (over websocket). The plugin is called stomp-plugin and we start with basic support to auto-detect the annotations.

timonback avatar Sep 25 '23 09:09 timonback

Basic example is pushed: https://github.com/springwolf/springwolf-core/tree/websockets-plugin

timonback avatar Sep 25 '23 11:09 timonback

The change is staged for release and will be part of the next release.

If you want to try and verify it in your application today, use the latest 1.X.0-SNAPSHOT build as described in our README.md > Testing SNAPSHOT version

Thank you for the report/contribution!

github-actions[bot] avatar Jun 21 '24 15:06 github-actions[bot]

The change is available in the latest release. 🎉

Thank you for the report/contribution and making Springwolf better!

github-actions[bot] avatar Jun 29 '24 11:06 github-actions[bot]