Port already in use due to local quoters
I tried to run this example with quoters running locally as well - as suggested in "Fetching a REST Resource". The (consumer) application failed to start due to Web server failed to start. Port 8080 was already in use.
IMHO there is no reason why this consumer application should fire up a web server.
Thus the solution for me was to change the main method to
new SpringApplicationBuilder(GsConsumingRestApplication.class)
.web(WebApplicationType.NONE) // .REACTIVE, .SERVLET
.run(args);
Would it be okay to include this in the repo?
Alternatively, you could change the spring-boot-starter-web dependency to spring-boot-starter-json. This includes all the dependencies needed for the consuming app, but doesn't add a web server to the classpath.
I tried to run this example with quoters running locally as well - as suggested in "Fetching a REST Resource". The (consumer) application failed to start due to
Web server failed to start. Port 8080 was already in use.IMHO there is no reason why this consumer application should fire up a web server.
Thus the solution for me was to change the main method to
new SpringApplicationBuilder(GsConsumingRestApplication.class) .web(WebApplicationType.NONE) // .REACTIVE, .SERVLET .run(args);Would it be okay to include this in the repo?
I would welcome that change as a PR. You are correct that there's no reason to fire up a web server for this application, and the reactive approach is a good way to avoid that unnecessary overhead.
I'm adding the good first issue label, in case someone wants to use it as their first contribution to Spring.
Alternatively, you could change the
spring-boot-starter-webdependency tospring-boot-starter-json. This includes all the dependencies needed for the consuming app, but doesn't add a web server to the classpath.
You are right. However, the solution proposed in the initial comment is better, because it removes the unnecessary overhead of starting a web server.