You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The phases used by the SmartLifecycle implementations for graceful shutdown have been updated. Graceful shutdown now begins in phase SmartLifecycle.DEFAULT_PHASE - 2048 and the web server is stopped in phase SmartLifecycle.DEFAULT_PHASE - 1024. Any SmartLifecycle implementations that were participating in graceful shutdown should be updated accordingly.
getPhase() for classes InputBindingLifecycle, OutputBindingLifecycle should be aligned too so graceful shutdown is working as excepted
The text was updated successfully, but these errors were encountered:
I tested the proposed solution, and it doesn't work. In our project, the web server receives an HTTP request and converts it into a message. This message is sent via Spring Cloud Stream and RabbitMQ to other services for processing. Meanwhile, the request waits on the web server for a response. Once the message is processed, the waiting request is retrieved, and the response to the HTTP request is sent.
In this case, it's necessary to perform a graceful shutdown of the web server first, followed by a graceful shutdown of the Spring Stream. This ensures that the web server stops accepting requests while the streams have enough time to finish processing all pending requests. Therefore, the getPhase method must return a value smaller than Integer.MAX_VALUE - 2048, such as Integer.MAX_VALUE - 3000.
spring-cloud-stream/core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/InputBindingLifecycle.java
Line 52 in e14bc1c
According to https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#updated-phases-for-graceful-shutdown:
Updated Phases for Graceful Shutdown
The phases used by the SmartLifecycle implementations for graceful shutdown have been updated. Graceful shutdown now begins in phase SmartLifecycle.DEFAULT_PHASE - 2048 and the web server is stopped in phase SmartLifecycle.DEFAULT_PHASE - 1024. Any SmartLifecycle implementations that were participating in graceful shutdown should be updated accordingly.
getPhase() for classes InputBindingLifecycle, OutputBindingLifecycle should be aligned too so graceful shutdown is working as excepted
The text was updated successfully, but these errors were encountered: