带有Reactive Starter的Spring Boot 2中未使用Netty Server [英] Netty Server isn't used in Spring Boot 2 with Reactive starter

查看:428
本文介绍了带有Reactive Starter的Spring Boot 2中未使用Netty Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Boot 2和反应式启动器来开发一个反应式项目.我的问题是,当我启动该应用程序时,它是启动了Tomcat服务器而不是Netty.

这是来自build.gradle文件的依赖项:

dependencies {
compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-webflux:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-hateoas:${springBootVersion}")
compile group: 'com.github.tomakehurst', name: 'wiremock', version: '2.15.0'
compile("ro.orange.omoney:lms-token-client:0.1.0-SNAPSHOT")
testCompile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")

}

您能告诉我为什么我会遇到这个问题吗? 谢谢!

解决方案

您的项目依赖于spring-boot-starter-hateoas,后者依赖于spring-boot-starter-web,后者依赖于spring-boot-starter-tomcat.最终的依赖性导致将Tomcat配置为运行该应用程序.

通常,您必须明确地排除spring-boot-starter-web才能绕过Tomcat的自动配置.

但是,在这种特殊情况下,我相信它不会有帮助,因为spring-boot-starter-hateoas项目尚不支持反应式堆栈上的Web(在Spring Boot 2.0.0.RELEASE中).

目前看来它是HATEOAS或反应性网络.

有关更多详细信息,请参见 HATEOAS关于Spring Flux/Mono响应./p>

I'm developing a reactive project using Spring Boot 2 and reactive starters. My problem is that when I start the app, the Tomcat server it's started instead of Netty.

Here is my dependencies task from build.gradle file:

dependencies {
compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-webflux:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-hateoas:${springBootVersion}")
compile group: 'com.github.tomakehurst', name: 'wiremock', version: '2.15.0'
compile("ro.orange.omoney:lms-token-client:0.1.0-SNAPSHOT")
testCompile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")

}

Can you tell me why I face this problem? Thank you!

解决方案

Your project depends on spring-boot-starter-hateoas, which depends on spring-boot-starter-web, which depends on spring-boot-starter-tomcat. The final dependency causes that Tomcat is configured to run the application.

In general, you would have to exclude spring-boot-starter-web explicitely to bypass Tomcat auto-configuration.

Though, in this particular case, I believe it won't help as spring-boot-starter-hateoas project doesn't support web on reactive stack yet (in Spring Boot 2.0.0.RELEASE).

It seems that it's either HATEOAS or reactive web at the moment.

See HATEOAS on Spring Flux/Mono response for more details.

这篇关于带有Reactive Starter的Spring Boot 2中未使用Netty Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆