Create springwolf-websockets-example
- Create a new submodule
springwolf-websockets-exampleinspringwolf-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.jsonfile 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.
Relates to https://github.com/springwolf/springwolf-core/issues/364, https://github.com/springwolf/springwolf-core/issues/61
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.
Basic example is pushed: https://github.com/springwolf/springwolf-core/tree/websockets-plugin
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!
The change is available in the latest release. 🎉
Thank you for the report/contribution and making Springwolf better!