-
Notifications
You must be signed in to change notification settings - Fork 264
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
Support to Spring Webflux (reactive handlers) #331
Comments
The traditional, blocking approach is supported via a Servlet Filter, which has the nice benefit of not being tied to Spring directly, i.e. it's useful for other frameworks as well. Is there a usable, standardized API for nio that Spring is using? |
https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-httphandler sounds like a good start. But also looks like there is no common API. |
I see your point. Spring Webflux is built on Project Reactor so we can built the reactive Filter using a common API like CompletableFuture's or RxJava because this libraries are compatible with Project Reactor. Could you give me more details on how the current Logbook integration with Spring works? |
It's basically just a servlet filter, see https://github.com/zalando/logbook/tree/master/logbook-servlet, that we register using Spring's |
Let me think of an approach, and I'll let you know if I can come up with a standard solution. |
A question, the logbook-core module is not tied to the servlet API? In this case, would it be possible to create a new module called spring-webflux or something similar? |
True.
Possible, yes. But I'd prefer a solution that is not tied to spring. |
+1 |
Not sure if this feature is still under consideration, but creating a Netty module would make this library easy to use also for Vert.x and Quarkus. |
That sounds promising then. Normally I'm opposed to bind myself to an implementation, but in this case it seems that Netty is pretty much the NIO framework of choice and we would cover the following application frameworks:
|
Anyone here who has experience customizing the netty setup (preferably adding custom channel handlers) for Vert.x, Quarkus and/or Micronaut? |
Turns out registering a custom ChannelHandler in using Spring WebFlux + Netty is easy. But for the others that seems to be hard:
|
I think Quarkus is running on top of Vert.x so, it might have the same problem. If Micronaut is planning to support it, I would still go for a Netty module, otherwise doing a Spring WebFlux specific one is easier. |
I already have a working Netty-based solution locally. I wanted to add tests for each framework. Spring works, but I stumpled for the other three. |
That's great!! Is it something you can share already? I would be interested to see if I can create a similar module for Vert.x |
I pushed my current branch here: https://github.com/zalando/logbook/tree/feature/netty/logbook-netty/src/main/java/org/zalando/logbook/netty Maybe the existing API for vert.x already allows enough to register it? See http://www.julienviet.com/advanced-vertx-guide/#integrating-netty |
Logbook already has Spring support to traditional controllers model. In Spring Boot 2.X was introduced the reactive programming model with spring-webflux. Would be nice have Logbook support to this approach
See more details of Webflux here: https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#spring-webflux
Context
I use Logbook for many micro-services in my job. We need to integrate Logbook in some reactive webflux services.
Possible Implementation
By WebHandler API? -> https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-web-handler-api
Thanks for your attention.
Greetings!
The text was updated successfully, but these errors were encountered: