Spring web-flux with Wildfly Swarm - java

My current microservice is build on wildfly swarm. To create reactive API i plan to use Spring WebFlux.
How can I inject the spring Http handler into swarm undertow fraction ?
Is this possible, or do i need to re-write my application on spring boot?

Related

Running Spring WebServices alongside Spring WebFlux using Tomcat

Just for context: How to route requests to a different servlet with WebFlux
Shortly, Netty web server is unable to run neither Apache CXF nor Spring WS because they work on top of Servlet API. But what about Tomcat? Tomcat supports newer Servlet API version
which in its turn supports reactive API (webflux).
The question is: Is it possible to run WebFlux with Tomcat server and Spring WS for SOAP ?
One servlet will be used for handling reactive operations, and the other for SOAP actions.
You cannot run webflux on Tomcat using servlet (needed for CXF/Spring WS).

Use embedded tomcat instead of netty with spring-gateway

I'm running this project: https://github.com/wdahlenburg/spring-gateway-demo
It uses netty by default, how can I change it to embedded tomcat instead? I've tried to modify the pom.xml and replaces spring-boot-starter-test with spring-boot-starter-tomcat, but it doesn't work.
Does anyone know how to do that?
I don't think it's possible, spring cloud gateway is build on top of reactive Spring WebFlux project and requires netty runtime, as stated in docs:
Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spring Webflux. It does not work in a traditional Servlet Container or when built as a WAR.

Is it possible to integrate existing SOAP endpoints within Spring Webflux?

I have an existing Spring Boot application (on Tomcat 7) which exposes certain REST endpoints using Spring-MVC and SOAP endpoints using CXF.
I am planning to migrate the application to Spring-Webflux to make the REST endpoints reactive, but have not been able to figure out a way to integrate SOAP endpoints to Spring Webflux ServletHttpHandlerAdapter class.
Does Spring Web Flux provide any way to do such a thing ?

Can I deploy a Spring WebFlux application as a WAR

Here
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
I read that "War deployment is not supported for WebFlux applications". Is it only restricted for spring-boot applications or I cant do it at all with spring web flux? Assuming I don't user boot configurations and starters.
You' referring to the Spring Boot documentation here - this limitation only applies to Spring Boot.
You can deploy a Spring WebFlux application (outside of Spring Boot) as a WAR file inside a Servlet 3.1+ container. For that, the Spring Framework reference documentation says:
To deploy as a WAR to any Servlet 3.1+ container, you can extend and
include AbstractReactiveWebInitializer in the WAR. That class wraps an
HttpHandler with ServletHttpHandlerAdapter and registers that as a
Servlet.

Enabling Actuator endpoints for Springboot app and embedded Netty server

i setup a service which uses spring boot application(for regular rest calls) and a embedded Netty server using NettyReactiveWebServerFactory in a different port (for eureka related calls).
All the actuator related functionality is applied to my main spring boot application but not to my embedded netty server.
Is there anyway where i can enable the actuator endpoints to both servers?
Used versions:
Spring boot version- 2.0.8, spring webflux
Spring cloud - Finchley.SR2

Categories