diff --git a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java index 85e4b99d2e17e..041fbeb4466e9 100644 --- a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java +++ b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaProducers.java @@ -33,8 +33,12 @@ public javax.transaction.UserTransaction userTransaction() { @Produces @ApplicationScoped + @Unremovable public XAResourceRecoveryRegistry xaResourceRecoveryRegistry() { - return new RecoveryManagerService(); + RecoveryManagerService recoveryManagerService = new RecoveryManagerService(); + recoveryManagerService.create(); + recoveryManagerService.start(); + return recoveryManagerService; } @Produces diff --git a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java index b66dd67487d37..7caf66cac74b8 100644 --- a/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java +++ b/extensions/narayana-jta/runtime/src/main/java/io/quarkus/narayana/jta/runtime/NarayanaJtaRecorder.java @@ -10,6 +10,7 @@ import com.arjuna.ats.arjuna.common.arjPropertyManager; import com.arjuna.ats.arjuna.coordinator.TransactionReaper; import com.arjuna.ats.arjuna.coordinator.TxControl; +import com.arjuna.ats.arjuna.recovery.RecoveryManager; import com.arjuna.ats.jta.common.jtaPropertyManager; import com.arjuna.common.util.propertyservice.PropertiesFactory; @@ -74,6 +75,7 @@ public void handleShutdown(ShutdownContext context) { context.addLastShutdownTask(new Runnable() { @Override public void run() { + RecoveryManager.manager().terminate(true); TransactionReaper.terminate(false); } });