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

Unexpected startup of web server with RabbitMQ starter #12853

Closed
nithia opened this issue Apr 13, 2018 · 4 comments
Closed

Unexpected startup of web server with RabbitMQ starter #12853

nithia opened this issue Apr 13, 2018 · 4 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@nithia
Copy link

nithia commented Apr 13, 2018

Since 2.0.1, Spring Boot creates a AnnotationConfigReactiveWebServerApplicationContext as the application context instead of, as in 2.0.0, AnnotationConfigApplicationContext. This happens even if there is no web functionality in the project. This leads to the application trying to start a Netty web server on port 8080 for no apparent reason.

The attached project was generated from start.spring.io and includes only a RabbitMQ starter. On startup it creates handlers for URLs /webjars/** and /** for no apparent reason. This is both surprising and inconvenient as there doesn't seem to be any easy way to turn it off.

demo.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 13, 2018
@snicoll
Copy link
Member

snicoll commented Apr 13, 2018

@nithia very nice, thank you for the sample. The AMQP client now brings reactor-netty and a bunch of other libraries that I wonder if they are legit. So your report is specific to AMQP only and looking at what is on the classpath, I think it's legit for Spring Boot to attempt to start a web server (in other words, something that the RabbitMQ starter brings is broken).

This is both surprising and inconvenient as there doesn't seem to be any easy way to turn it off.

If you have a web environment and you want to disable it, add this to application.properties:

spring.main.web-application-type=none

I thought this was documented explicitly but it isn't so we should fix that as well.

@snicoll snicoll changed the title Since 2.0.1 Spring Boot automatically creates AnnotationConfigReactiveWebServerApplicationContext even for non-web projects Unexpected startup of web server with RabbitMQ starter Apr 13, 2018
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Apr 13, 2018
@snicoll
Copy link
Member

snicoll commented Apr 13, 2018

I've added a section in the doc in 31441a7

@snicoll snicoll removed the for: team-attention An issue we'd like other members of the team to review label Apr 13, 2018
@nithia
Copy link
Author

nithia commented Apr 13, 2018

Thanks for the speedy response @snicoll 👍 Adding the property solves my immediate problem. Now I can get those Ops people off my back :)

@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 13, 2018
@snicoll snicoll added this to the 2.0.x milestone Apr 13, 2018
@snicoll
Copy link
Member

snicoll commented Apr 13, 2018

If we want to fix in 2.0.x, we'll have to exclude that dependency in Spring Boot as Spring AMQP has no plan to do this short term

@snicoll snicoll self-assigned this Apr 26, 2018
@snicoll snicoll modified the milestones: 2.0.x, 2.0.2 Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants