Starting Spring Boot applications in a non-web mode

Since both Image Resize Request Producer and Image Resize Request Consumer need to run as console applications, which shouldn't run inside a web container, such as Tomcat, Jetty, a slightly different bootstrapping code, is used in the main methods, as follows:

public static void main(String... args) {
new SpringApplicationBuilder(ConfigClass.class).web(WebApplicationType.NONE).build().run(args);
}

In the preceding code, the SpringApplicationBuilder builder class is used to non-web the Spring Boot application. ConfigClass.class needs to be replaced with the actual configuration class that defines the beans. Finally, it is built and run.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.6.243