Closed gastaldi closed 11 months ago
@jhalliday can you please take a look if this makes sense?
@vsevel in case you have recovery enabled, can you test with this PR if the transaction is correctly recovered in case of a server crash?
no. we do not have recovery enabled.
@gastaldi I add a crash recovery test https://github.com/zhfeng/jca-recovery-test. Only test it on JVM mode.
./mvnw clean package
docker run --name artemis \
-e AMQ_USER=admin -e AMQ_PASSWORD=admin \
-d -p 61616:61616 \
quay.io/artemiscloud/activemq-artemis-broker
- run the application
java -jar target/quarkus-app/quarkus-run.jar
- send a `crash` message
curl -X POST http://localhost:8080/jca?name=crash
- restart the application and you can see such logs
2023-11-21 11:19:22,476 INFO [io.qua.iro.runtime] (jca-worker-pool-
- check the message
curl http://localhost:8080/jca
and you will get `Hello crash`.
I'll do a minor refactoring before merging this PR
@gastaldi I have some changes to add a property to disable passing XATerminator
in some case. see https://github.com/zhfeng/quarkus-ironjacamar/commit/af88d23b1be05d84b1cd35324c31dd546e90247b
Is there any chance to add it?
@zhfeng Interesting, but it doesn't make much sense to me TBH. Can you elaborate on why this is needed?
Well, when we did a test with DTPRA (which is used to connect to the mainframe system), it would use XATerminator
to run a inboundXids recovery in a seperate thread like DTPMAIN
. And this causes the some failures confilcting with quarkus-agroal
in narayana recovery thread due to https://issues.redhat.com/browse/AG-227 . Now the only way to disable its recovery thread in DTPRA is disabling passing XATerminator
in BootStrapContext. Yeah, this looks like a workaround and we need to fix AG-227 later. Also it could re-consider with https://issues.redhat.com/browse/JBTM-3325 in narayana side.
I see. The best solution in this case IMHO is to change the DTPRA adapter to ignore that (maybe through a flag in the adapter), not the extension.
I'll do a minor refactoring before merging this PR
Refactoring done. @zhfeng can you review it before this gets merged?
I think we're now ready for a 1.1.0 release. @zhfeng Should we add something else?
Yeah, I think we are good for a new release. The only thing I think is to add a NOTE in docs to emphasis that if running in a XA transacction, it recommend to enable recovery by using quarkus.transaction-manager.enable-recovery=true
also referring to Quarkus transaction guide . Anyway, we can do this after releasing.