engine.io-server-java icon indicating copy to clipboard operation
engine.io-server-java copied to clipboard

Support for Spring Reactive

Open dineshvenkat opened this issue 5 years ago • 7 comments

Is it possible to integrate this library with Spring reactive framework which is no longer supporting HttpServletRequests? Not able to use the Spring example here https://socketio.github.io/engine.io-server-java/spring-integration.html to integrate the library with Spring Webflux.

dineshvenkat avatar Jul 13 '20 17:07 dineshvenkat

I'll need to explore this more. I'll get back to you.

trinopoty avatar Jul 13 '20 18:07 trinopoty

Hi, Did you get a chance to look at this? We are already using Spring Webflux extensively and it will be great for us to integrate and use this library if it has support for Spring Webflux.

dineshvenkat avatar Jul 20 '20 14:07 dineshvenkat

It seems like Spring Webflux indeed does not provide a way to get HttpServletRequest. Currently, the only way to use engine.io/socket.io with Spring Webflux is to add a servlet above Spring's DispatcherServlet. Hopefully, I will figure out how to make engine.io work with Spring Webflux soon.

trinopoty avatar Jul 20 '20 15:07 trinopoty

Great to know you are planning to figure this out. Will this be planned against any Java Engine.io release? Wondering whether this is some minor enhancement we can wait for few days or look for other options.

dineshvenkat avatar Jul 29 '20 18:07 dineshvenkat

While I do hope to be able to get to this soon. If your need is urgent, I suggest trying out other solutions in the meantime.

trinopoty avatar Jul 29 '20 21:07 trinopoty

It seems like it's possible to use Spring MVC and Spring Webflux together in a single project. If possible, please try that approach out.

trinopoty avatar Jul 30 '20 15:07 trinopoty

I've had a look at this and it'll require significant rework of the library to make it compatible with Webflux. Needless to say, this will take some time. I'd advise trying out other methods in the meantime.

trinopoty avatar Aug 11 '20 16:08 trinopoty