Use `ArmeriaServerGracefulShutdownLifecycle` to start `Server` with Spring integration
See original GitHub issueArmeria Server is started before Spring Application contexts are fully initialized when using the Spring integration module.
https://github.com/line/armeria/blob/be2bf5176dc20cc868011e9239510f2feac87328/spring/boot2-autoconfigure/src/main/java/com/linecorp/armeria/spring/AbstractArmeriaAutoConfiguration.java#L104-L110
If a Server early binds to a port before the application is ready, many pending requests are queued and it will cause GC pressure.
I think we can use ArmeriaServerGracefulShutdownLifecycle added in #3226 to start up a Server leveraging Spring beans’ lifecycle.
https://github.com/line/armeria/blob/f3cc329530a83ec47ed08c8e8be1443437e55de7/spring/boot2-autoconfigure/src/main/java/com/linecorp/armeria/spring/ArmeriaServerGracefulShutdownLifecycle.java#L36-L42
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (6 by maintainers)

Top Related StackOverflow Question
I’ll check a little more and send a PR 😄
LGTM, I checked the PR in the above comment, just need to double confirm the case in the comment that heowc also answered^^