From bfa8efbf557f5155d293ae360f1b16847768c276 Mon Sep 17 00:00:00 2001 From: Benjamin Graf Date: Wed, 9 Oct 2024 20:49:59 +0200 Subject: [PATCH] Enhancing documentation to reflect #165 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 3dce4f70..51b3f911 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,21 @@ configure the `narayana.node-identifier` property with a different value for eac must not exceed a length of 28 bytes. To ensure that the value is shorten to a valid length by hashing with SHA-224 and encoding with base64, configure `narayana.shorten-node-identifier-if-necessary` property to true. +# Batch application + +If you are running your Spring Boot application as a batch program, you'll have to explicitly call exit (`SIGTERM`) on your application to proper shutdown. +This is needed because of Narayana is running periodic recovery in a non-daemon background thread. + +This could be achieved with the following code example: +```java +@SpringBootApplication +public class Application { + public static void main(String[] args) { + SpringApplication.exit(SpringApplication.run(Application.class, args)); + } +} +``` + # Using databases By default Narayana Transactional driver is used to enlist a relational database to a JTA transaction which provides a basic XAResource enlistment and recovery.