You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Raphaël Delaporte <ra...@gmail.com> on 2010/01/16 19:41:30 UTC

Transaction rollback to JBI endpoint

Hi,

I'm using Camel 1.6 with ServiceMix 3.3.

This is my route :
JBI JMS consumer (with ServiceMix) -> Camel JBI endpoint -> Bean.

My JMS consumer is XA transacted and when it fails to call the Camel JBI
endpoint, the JMS Message is rolledback into the queue (this is what I
want).

But if I call the JBI Camel endpoint, and if my bean throws an Exception,
the JMS message is not rolledback into the queue. I want the transaction to
be rolledback on any errors in the Camel routes.
Here is my configuration

    from("jbi:endpoint:http://esb/CamelTransac/transac")
            .to(LOG)
            .beanRef("routes", "erreur");


    public void erreur() throws Exception {
        Thread.sleep(1000);
        throw new Exception("erreur !");
    }

I have tried to set errorHandler(noErrorHandler()), but it does the same
thing.

Any ideas ?

Thanks !
Raphaël

Re: Transaction rollback to JBI endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
2010/1/17 Raphaël Delaporte <ra...@gmail.com>:
> Yes that's right, but I did not know where was the mistake.
> Please forget this post since this is not camel related.
>

I just posted to ensure that if other read / find this post in the
future they know where to look for the answers.


> Raphaël
>
>
> 2010/1/17 Claus Ibsen <cl...@gmail.com>
>
>> 2010/1/16 Raphaël Delaporte <ra...@gmail.com>:
>> > Hi,
>> >
>> > I'm using Camel 1.6 with ServiceMix 3.3.
>> >
>> > This is my route :
>> > JBI JMS consumer (with ServiceMix) -> Camel JBI endpoint -> Bean.
>> >
>> > My JMS consumer is XA transacted and when it fails to call the Camel JBI
>> > endpoint, the JMS Message is rolledback into the queue (this is what I
>> > want).
>> >
>> > But if I call the JBI Camel endpoint, and if my bean throws an Exception,
>> > the JMS message is not rolledback into the queue. I want the transaction
>> to
>> > be rolledback on any errors in the Camel routes.
>> > Here is my configuration
>> >
>> >    from("jbi:endpoint:http://esb/CamelTransac/transac")
>> >            .to(LOG)
>> >            .beanRef("routes", "erreur");
>> >
>> >
>> >    public void erreur() throws Exception {
>> >        Thread.sleep(1000);
>> >        throw new Exception("erreur !");
>> >    }
>> >
>> > I have tried to set errorHandler(noErrorHandler()), but it does the same
>> > thing.
>> >
>> > Any ideas ?
>> >
>>
>> This is cross posted in SMX user forum as well where its debated.
>>
>> > Thanks !
>> > Raphaël
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Transaction rollback to JBI endpoint

Posted by Raphaël Delaporte <ra...@gmail.com>.
Yes that's right, but I did not know where was the mistake.
Please forget this post since this is not camel related.

Raphaël


2010/1/17 Claus Ibsen <cl...@gmail.com>

> 2010/1/16 Raphaël Delaporte <ra...@gmail.com>:
> > Hi,
> >
> > I'm using Camel 1.6 with ServiceMix 3.3.
> >
> > This is my route :
> > JBI JMS consumer (with ServiceMix) -> Camel JBI endpoint -> Bean.
> >
> > My JMS consumer is XA transacted and when it fails to call the Camel JBI
> > endpoint, the JMS Message is rolledback into the queue (this is what I
> > want).
> >
> > But if I call the JBI Camel endpoint, and if my bean throws an Exception,
> > the JMS message is not rolledback into the queue. I want the transaction
> to
> > be rolledback on any errors in the Camel routes.
> > Here is my configuration
> >
> >    from("jbi:endpoint:http://esb/CamelTransac/transac")
> >            .to(LOG)
> >            .beanRef("routes", "erreur");
> >
> >
> >    public void erreur() throws Exception {
> >        Thread.sleep(1000);
> >        throw new Exception("erreur !");
> >    }
> >
> > I have tried to set errorHandler(noErrorHandler()), but it does the same
> > thing.
> >
> > Any ideas ?
> >
>
> This is cross posted in SMX user forum as well where its debated.
>
> > Thanks !
> > Raphaël
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Re: Transaction rollback to JBI endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
2010/1/16 Raphaël Delaporte <ra...@gmail.com>:
> Hi,
>
> I'm using Camel 1.6 with ServiceMix 3.3.
>
> This is my route :
> JBI JMS consumer (with ServiceMix) -> Camel JBI endpoint -> Bean.
>
> My JMS consumer is XA transacted and when it fails to call the Camel JBI
> endpoint, the JMS Message is rolledback into the queue (this is what I
> want).
>
> But if I call the JBI Camel endpoint, and if my bean throws an Exception,
> the JMS message is not rolledback into the queue. I want the transaction to
> be rolledback on any errors in the Camel routes.
> Here is my configuration
>
>    from("jbi:endpoint:http://esb/CamelTransac/transac")
>            .to(LOG)
>            .beanRef("routes", "erreur");
>
>
>    public void erreur() throws Exception {
>        Thread.sleep(1000);
>        throw new Exception("erreur !");
>    }
>
> I have tried to set errorHandler(noErrorHandler()), but it does the same
> thing.
>
> Any ideas ?
>

This is cross posted in SMX user forum as well where its debated.

> Thanks !
> Raphaël
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus