Context close docs

- Backport #863
- Relates #866
This commit is contained in:
Janne Valkealahti
2023-09-21 07:48:51 +01:00
parent b9be826c9c
commit 5739df406a
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
[[using-shell-customization-contextclose]]
=== Context Close
Command execution logic happens via Spring Boot's `ApplicationRunner` beans.
Normally Spring `ApplicationContext` closes automatically after these runner
beans has been processed unless there is something what keeps it alive like
use of `@EnableScheduling` or generally speaking there are threads which
don't die automatically.
It is possible to add configuration property `spring.shell.context.close`
which registers `ApplicationListener` for `ApplicationReadyEvent` and requests
context close after shell has completed its execution logic.
[source, yaml]
----
spring:
shell:
context:
close: true
----
NOTE: This setting is not enabled by default.

View File

@@ -10,3 +10,5 @@ include::using-shell-customization-logging.adoc[]
include::using-shell-customization-commandnotfound.adoc[]
include::using-shell-customization-singlecommand.adoc[]
include::using-shell-customization-contextclose.adoc[]