I am not saying async is useless, sorry if I misrepresented that. I am saying that Narayana is not necessarily the right place to build an MDB-like container.
If you call setMessageListener on an XAConnection it would be really unlikely that the JMS implementation would do the right thing to set up the TX before calling your onMessage as they expect a "container" to do that normally.
As such someone has to implement the pseudocode I provided above. If the above is all you need just drop it into your app, you would still benefit from Narayana by the the that when you call getXASession this will attach to the TX and when you use the DB it will be in the same TX.
Perhaps I misunderstood what you are proposing and if so please provide some pseudo-code.
gytis The feature request is already there : [JBTM-2658] Implement JMS integration classes for MessageListener - JBoss Issue Tracker
I've made a PR to show what I had in mind. Nothing like a container, just an extension of the proxy chain.
Thanks Alexis. I'll take a look.
I understand the approach but JBTM-2658 Implement JMS integration classes for MessageListener by hasalex · Pull Request #1004 · jbosstm/narayana · Git… _is_ sort of a container IMO.
There are different ways to do/log the transaction handling for example.
How about if we allow some kind of lambda to be passed in to do the "container-lite" functionality however that would be a proprietary API then unless instead of a lambda we configure the connection factory with a class name of where the routine to use is?
Just to wrap up this thread. We did identify on the PR that the proposed solution was built on implementation conventions in a particular JMS vendor and was not portable from the JMS API point of view. As such Alexis closed his PR for further future analysis.
Thanks for the contribution anyway - if there is something further we can reopen.
One comment regarding this package (org.jboss.narayana.jta.jms). While it is present in the jar published on maven (http://central.maven.org/maven2/org/jboss/narayana/jta/narayana-jta/5.7.1.Final/narayana-jta-5.7.1.Final.jar) for some reason its source is not present in the corresponding -sources.jar: (http://central.maven.org/maven2/org/jboss/narayana/jta/narayana-jta/5.7.1.Final/narayana-jta-5.7.1.Final-sources.jar)