Spring Boot without the web server

后端 未结 16 827
眼角桃花
眼角桃花 2020-11-29 16:50

I have a simple Spring Boot application that gets messages from a JMS queue and saves some data to a log file, but does not need a web server. Is there any way of starting S

16条回答
  •  盖世英雄少女心
    2020-11-29 17:01

    Use this code.

    SpringApplication application = new SpringApplication(DemoApplication.class);
    application.setWebApplicationType(WebApplicationType.NONE);
    application.run(args);
    

提交回复
热议问题