- ServletContextListener 구현 후 Bean 등록하면 종료 이벤트 메소드에서 작업 가능

- graceful shutdown custom
https://www.springcloud.io/post/2022-02/spring-boot-graceful-shutdown/#gsc.tab=0



- shutdown spring boot Application
https://www.baeldung.com/spring-boot-shutdown

- errorChannel 에러 발생시 참고
https://solace.community/discussion/272/immediate-application-shutdown-after-succesful-start


@SpringBootApplication
public class Application {

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    public static void main(String[] args) {
        SpringApplication.run(Application.class);
    }

    @Bean
    public Consumer<String> appCreatedConsumer() {
        return String -> {
            System.out.println("String created: " + String);
        };
    }

    @Bean
    public Supplier<String> appCreatedSupplier() {
        return () -> new String("Test");
    }
}



'spring-boot' 카테고리의 다른 글

response json default 설정 - Content Negotiation  (0) 2023.07.27
빈 등록/삭제  (0) 2023.07.26
spring boot graceful timeout  (0) 2023.06.19
default TimeZome & Locale 설정  (0) 2023.06.02
handle exception by using spring redis cache  (0) 2023.05.17
Posted by 張's blog
,