Again. Well, it appears to me that I have to set DONE on the me on the polling side and send the me again to the delivery channel (actually as an answer and to release the sendSync-answer from waiting.
Now, if that were true, it'll work just like described on the page http://goopen.org/confluence/display/SM/Transactions http://goopen.org/confluence/display/SM/Transactions except that the second send is a send() rather than a sendSync() - I mean the one that follows setting DONE to the me. Guillaume, would you kindly confirm if this is true? Cheers again. Martin gnodet wrote: > > If you receive a synchronous transactional exchange, you > need to answer using sendSync, so that the transaction > is also conveyed synchronously back to the consumer > component. > You can check if the jbi exchange is synchronous and transacted > with the following code: > boolean txSync = exchange.isTransacted() && > Boolean.TRUE.equals(exchange.getProperty(JbiConstants.SEND_SYNC)); > > If txSync is true, you MUST use sendSync to send the answer. > > On 9/20/06, Martin Landua <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I have written a polling component which generates messages that it is >> sending to its delivery channel synchronously. It operates on a InOut >> Message Exchange. >> Also, I have created an OutBinding component, which is supposed to create >> an >> answer to the message that it receives. The answer is being sent through >> the >> answer method of the OutBinding component. >> Now it appears to me that everything works fine as long as the polling >> component does not create a transaction. If it does, the answer() method >> actually throws an exception, because it cannot find an appropriate flow >> that can handle this message exchange. >> From what I can tell from the sources, the SedaFlow checks whether it can >> handle a ME. And it does it like this: >> >> public boolean canHandle(MessageExchange me) { >> if (isPersistent(me)) { >> return false; >> } >> if (isClustered(me)) { >> return false; >> } >> if (isTransacted(me)) { >> if (!isSynchronous(me)) { >> // we have the mirror, so the role is the one for the >> target >> component >> if (me.getStatus() == ExchangeStatus.ACTIVE) { >> return false; >> } >> } >> } >> return true; >> } >> >> >> The problem here is that the answer() method actually clears the >> SEND_SYNC >> property, therefore the ME appears to be async although it is not. And >> why >> does this test only happen when transactions are enabled? >> >> Am I using the wrong flow? >> Please note that I'm running ServiceMix in JBoss using the JBoss deployer >> (all built from SVN-Head). >> >> Any advice? >> >> Cheers >> Martin >> -- >> View this message in context: >> http://www.nabble.com/Answering-synchronous-transactional-InOut-MEP-tf2307890.html#a6416047 >> Sent from the ServiceMix - User mailing list archive at Nabble.com. >> >> > > > -- > Cheers, > Guillaume Nodet > > -- View this message in context: http://www.nabble.com/Answering-synchronous-transactional-InOut-MEP-tf2307890.html#a6416815 Sent from the ServiceMix - User mailing list archive at Nabble.com.
