-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer "websocket" option, when selecting Spring Webflux #16942
Comments
This comment from @cbornet might help explain why we don't offer it:
|
So should jhipster move to RSocket instead of Websocket? |
Thanks for your response. AFAIK, if a WebSocket connection is about to establish it does a handshake with the backend and requests an UPGRADE. Is it impossible to establish a "wss://" exchange with some "handler" and do an, i.e. JWT authenticated request? Btw. I found that issue you mention webflux does not work with stomp and they would investigate on RSocket, but I don't understand what that means. Does JHipster "drop" that fancy WebSocket in favor of another "insert-fancy-lib-here" ;-) or call it RSocket? |
This issue is stale because it has been open 30 days with no activity. |
Given our websocket support is just minimal its not worth supporting in webflux IMO. It should be trivial to build for users using another method |
Overview of the feature request
Please implement a "WebSockets using Spring Websocket" option, when a project with "reactive" Spring Webflux and Angular frontend was selected.
Motivation for or Use Case
I am to create a responsive website with a green meadow Spring Webflux backend and have to continuously update the Angular frontend with consumed information from a Kafka ensemble read by the Jhipster spring backend.
I selected Webflux when generating the project, but the option Websockets was not offered in the terminal options. So I had to integrate the required Spring maven packages into the
pom.xml
and implement WebSocketConfig, WebSocketSecurityConfig classes plus Endpoint on my own. The Angular client must authenticate in order to prove, if the user is allowed to read the processed messages.Then I tried to connect with the Angular frontend to the backend and was asked for a JWT. It was impossible to connect. Perhaps some weird security configs of Spring which are like a closed book. Even when "permitAll" on everything, a connection wasn't possible. Even, if I use Postman as cUrl-GUI-Tool with websocket request generator, the connection was refused.
My 2nd try was to generate a non-reactive project with Jhipster, where I could dissect the "Tracker" example and integrate it into my project.
But here a huge amount of complex errors arised - mostly from maven package problems. I was able to solve them, but at this stage I wasn't able to solve it;
Bean named 'corsFilter' is expected to be of type 'org.springframework.web.filter.CorsFilter' but was actually of type 'org.springframework.web.cors.reactive.CorsWebFilter'
. It has perhaps something to do with the Spring Webflux and Spring MVC package interactions,It would help to solve a lot of problems:
Related issues or PR
The text was updated successfully, but these errors were encountered: