-
1. Re: How to enable RESTAT participants to participate in a JTA transaction running inside Tomcat?
gytis Mar 23, 2016 4:36 AM (in response to lin_jboss)Hi, Frank.
We do not have outbound bridge implemented. So far we didn't have people interested in it, thus we didn't look into it.
However, if there would be more interest we might add it into the future release.
-
2. Re: How to enable RESTAT participants to participate in a JTA transaction running inside Tomcat?
mmusgrov Mar 29, 2016 5:08 AM (in response to lin_jboss)Although we do not provide an outbound bridge maybe an approach I posted on the resteasy email list could work for you. Suppose there are two web applications A and B whose work needs to be performed inside the same transaction:- A starts a JTA transaction and invokes REST endpoints in app B. To get the intended behaviour you could start a REST-AT transaction and then emulate what we do with the "inbound bridge" by manually starting a bridge before doing your JTA work. Something similar to:
- EJB in web app A will start a REST-AT transaction;
- EJB in web app A will start an InboundBridge (instead of the JTA transaction):
- InboundBridge inboundBridge = InboundBridgeManager.getInstance().createInboundBridge("enlistmentUrl from step 1");
- inboundBridge.start();
- EJB in web app A will perform JTA work (insert some records in a database, send JMS messages etc);
- invoke a REST endpoint in app B passing the enlistmentUrl in a Link header;
- mark up the REST endpoint in app B (using the javax.transaction.Transactional annotation) - this will automatically start an instance of the inbound bridge;
- commit the REST-AT transaction started in step 1. This will cause the work done in B and in A to commit within the context of the single REST-AT transaction.
-
3. Re: How to enable RESTAT participants to participate in a JTA transaction running inside Tomcat?
mmusgrov Mar 29, 2016 6:07 AM (in response to mmusgrov)5. mark up the REST endpoint in app B (using the javax.transaction.Transactional annotation) - this will automatically start an instance of the inbound bridge;
Note that step 5 is only required if REST app B also needs to perform JTA work.