Skip to content
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 Spring 5 & Spring Boot 2 reactive web #1377

Closed
sameer-pandit opened this issue Oct 4, 2016 · 8 comments
Closed

Support Spring 5 & Spring Boot 2 reactive web #1377

sameer-pandit opened this issue Oct 4, 2016 · 8 comments

Comments

@sameer-pandit
Copy link

I tried adding spring cloud eureka, to pom.xml (for reactor-netty profile)of spring-boot-sample-web-reactive, I am getting the below error in test of sample. What is the correct way to use eureka discovery service for spring boot web reactive app. Same Issue against spring boot web reactive was closed, and @bclozel suggested to add issue against spring cloud eureka.

Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start ReactiveWebApplicationContext due to missing ReactiveHttpServerFactory bean.

Below are changes made to pom.xml of spring-boot-sample-web-reactive

diff --git a/spring-boot-sample-web-reactive/pom.xml b/spring-boot-sample-web-reactive/pom.xml
index 7948b03..ce56ae7 100644
--- a/spring-boot-sample-web-reactive/pom.xml
+++ b/spring-boot-sample-web-reactive/pom.xml
@@ -12,7 +12,12 @@
        <name>Sample project for Spring Boot Web Reactive</name>
        <description>Spring Boot Web Reactive Sample</description>

-
+    <repositories>
+       <repository>
+          <id>spring-maven</id>
+          <url>http://maven.springframework.org/release</url>
+       </repository>
+    </repositories>
     <profiles>
         <profile>
             <id>tomcat</id>
@@ -23,7 +28,7 @@
                 <dependency>
                     <groupId>org.springframework.boot.experimental</groupId>
                     <artifactId>spring-boot-starter-web-reactive</artifactId>
-                </dependency>
+                </dependency>                
                                <!-- Using Reactor Netty HTTP client in tests -->
                                <dependency>
                                        <groupId>io.projectreactor.ipc</groupId>
@@ -55,6 +60,11 @@
                     <groupId>io.projectreactor.ipc</groupId>
                     <artifactId>reactor-netty</artifactId>
                 </dependency>
+                <dependency>
+                    <groupId>org.springframework.cloud</groupId>
+                    <artifactId>spring-cloud-starter-eureka</artifactId>
+                    <version>1.2.0.RELEASE</version>
+                </dependency>
             </dependencies>
         </profile>
@ryanjbaxter
Copy link
Contributor

Usually you would use the Spring Cloud BOM and add the dependency

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Camden.BUILD-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot.experimental</groupId>
                <artifactId>spring-boot-dependencies-web-reactive</artifactId>
                <version>0.1.0.BUILD-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>

However even when doing that I also see the same error. I don't believe we have started looking at supporting anything other than Spring Boot 1.4.x and 1.5.x at this point though.

@spencergibb
Copy link
Member

👍 to what @ryanjbaxter said, we haven't started reactive support yet.

@spencergibb spencergibb changed the title Adding spring cloud eureka to sample app causes test failure Support Spring 5 reactive Oct 5, 2016
@spencergibb spencergibb changed the title Support Spring 5 reactive Support Spring 5 & Spring Boot 2 reactive web Oct 5, 2016
@spencergibb
Copy link
Member

May as well use this as the placeholder. Work will be part of the Edgware release (just released Camden, Dalston targeting end of 2016).

@sameer-pandit
Copy link
Author

sameer-pandit commented Oct 5, 2016

I am guessing this due to some conflicting dependencies, is there some work around for now ?

@bclozel
Copy link
Contributor

bclozel commented Oct 5, 2016

@sameer-pandit reactive streams is a rather different paradigm and supporting that needs quite a lot of work. I don't think there's a workaround for that.

@noorulhaq
Copy link

In case if you are still wondering how to acheive that. Then I have done some experiment that is available on github.
Read below article for more detail.
https://dzone.com/articles/functional-amp-reactive-spring-along-with-netflix

@breun
Copy link

breun commented Oct 2, 2017

Currently you end up with converting reactive stream types twice if you want call external services in a Spring WebFlux web application using Spring Cloud Netflix, because Hystrix only supports RxJava 1 Observable as a reactive return type:

WebClient -> Reactor type (Mono/Flux) -> convert to RxJava 1 Observable -> Hystrix command/annotation -> convert Observable back to Reactor type (Mono/Flux) -> WebFlux controller returns Reactor type

@spencergibb
Copy link
Member

This has been supported since Finchley.RELEASE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants