Spring Framework
spring boot 3.2.x 가상스레드 설정 방법
터프남
2024. 5. 6. 23:15
728x90
반응형
spring.threads.virtual.enabled=true
spring docs에서는 애플리케이션에 이 옵션을 켜기 전에 공식 Java 가상 스레드 설명서를 읽어보시기 바랍니다 라고 쓰여져있다.
Warning
One side effect of virtual threads is that they are daemon threads. A JVM will exit if all of its threads are daemon threads. This behavior can be a problem when you rely on @Scheduled beans, for example, to keep your application alive. If you use virtual threads, the scheduler thread is a virtual thread and therefore a daemon thread and won’t keep the JVM alive. This not only affects scheduling and can be the case with other technologies too. To keep the JVM running in all cases, it is recommended to set the property spring.main.keep-alive to true. This ensures that the JVM is kept alive, even if all threads are virtual threads.
참고
Spring Boot Reference Documentation
This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe
docs.spring.io
Core Libraries
Virtual threads are lightweight threads that reduce the effort of writing, maintaining, and debugging high-throughput concurrent applications.
docs.oracle.com
728x90
반응형