I got the scenario working, we need to set the property "SET_ROLLBACK_ONLY" to true in case of a rollback.
Rajika On Mon, Jan 18, 2010 at 5:23 PM, Rajika Kumarasiri <raj...@wso2.com> wrote: > > > On Mon, Jan 18, 2010 at 5:08 PM, Amila Suriarachchi < > amilasuriarach...@gmail.com> wrote: > >> On Mon, Jan 18, 2010 at 10:54 AM, Rajika Kumarasiri <raj...@wso2.com> >> wrote: >> >> > hi, >> > I was trying to get the following scenario working using distributed JMS >> > transaction support (jta) in JMS listener so far without any success. I >> am >> > trying this using synpase and the JMS transport I think this is the best >> > place to ask the question. >> > >> > Scenario is to read a JMS message from a queue and send it to a back end >> > service using http transport. In case of a failure in back end service ( >> > server down, network unreachable etc..) , need to re-send the same >> message. >> > In other word the message should only remove from the queue only in case >> of >> > a successful delivery. I tried using the JTA JMS support in JMS >> > listener(according to how JMS transaction is written in JMS listener it >> > commit the transaction if it able to read the message successfully from >> the >> > queue), >> >> Amila, > See my comments in line. > >> >> I think you don't have to use the distributed transactions here since >> there >> are no two >> transactional sources. >> > > Yes, I think you are right. > > >> >> Your problem is that JMS commits the transaction before it calls >> AxisEngine.receive(). >> > > Not really, JMSListener will commit or rollback the transaction upon > successful/failure return from AxisEngine.receive(). See > ServiceTaskManager.java:518 and ServiceTaskManager.java:561. > > >> So I think this should be fixed at the transport level so that it should >> commit only if sucess and rollback >> then operation if AxisEngine.receive() throws and AxisFault. >> > > Yes I think the transaction implementation requires some re-factoring, even > the distributed transaction created in JMS Listener is tightly bind to JMS > sender which actually not required. > > Rajika > >> >> thanks, >> Amila. >> >> >> > then I tried using tx-mediator to mark the start/end/rollback of the >> > distributed transaction and that didn't work either. Does anybody has >> any >> > idea on how to get this scenario working? >> > >> > Rajika >> > >> >> >> >> -- >> Amila Suriarachchi >> WSO2 Inc. >> blog: http://amilachinthaka.blogspot.com/ >> > >