You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by kishoreJ <ki...@gmail.com> on 2015/08/20 05:02:47 UTC

Apache Camel XA transaction

 have to send a message to an endpoint using camel and at the same time if
the message is sent successfull then i have to update the database ..

These two steps should be done in a single transaction

Now i have to roll back the camel message if there is any exception in
updating the database or i have to roll back db transaction if there is any
exception in sending the message.

so i have to either send both at the same time or if there is any exception
in one case then i have to rollback both at the same time.

Does anyone have any clue?



--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-XA-transaction-tp5770836.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Apache Camel XA transaction

Posted by Christian Müller <ch...@gmail.com>.
Sorry, I mean this one:
https://github.com/muellerc/camel-in-transaction/tree/master/src/test/java/org/apache/cmueller/camel/samples/camelone/xa

Best,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Mon, Aug 24, 2015 at 10:49 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Have a look here:
>
> https://github.com/muellerc/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/tx/JmsAndJdbcCompensationTransactionSampleTest.java
>
> Hope this helps,
>
> Christian
> -----------------
>
> Software Integration Specialist
>
> Apache Member
> V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
> Apache Incubator PMC Member
>
> https://www.linkedin.com/pub/christian-mueller/11/551/642
>
> On Thu, Aug 20, 2015 at 3:52 PM, kishoreJ <ki...@gmail.com> wrote:
>
>> Hi claus
>>
>> But in that transactional client it is not specifying anything about what
>> i
>> need .
>>
>>
>> I have to update a database if the message is sent successfully to a
>> queue ,
>> if one fails then i have to roll back both the transactions.
>> Here i am dealing with a database transaction and a camel transaction.
>>
>> If any of one fails i have to roll back both the transactions there is
>> nothing mentioned about rolling back both database transaction and camel
>> transaction at a time in that article.
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Apache-Camel-XA-transaction-tp5770836p5770855.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>

Re: Apache Camel XA transaction

Posted by Christian Müller <ch...@gmail.com>.
Have a look here:
https://github.com/muellerc/camel-in-transaction/blob/master/src/test/java/org/apache/cmueller/camel/samples/camelone/tx/JmsAndJdbcCompensationTransactionSampleTest.java

Hope this helps,

Christian
-----------------

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Thu, Aug 20, 2015 at 3:52 PM, kishoreJ <ki...@gmail.com> wrote:

> Hi claus
>
> But in that transactional client it is not specifying anything about what i
> need .
>
>
> I have to update a database if the message is sent successfully to a queue
> ,
> if one fails then i have to roll back both the transactions.
> Here i am dealing with a database transaction and a camel transaction.
>
> If any of one fails i have to roll back both the transactions there is
> nothing mentioned about rolling back both database transaction and camel
> transaction at a time in that article.
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Apache-Camel-XA-transaction-tp5770836p5770855.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Apache Camel XA transaction

Posted by kishoreJ <ki...@gmail.com>.
Hi claus

But in that transactional client it is not specifying anything about what i
need .


I have to update a database if the message is sent successfully to a queue ,
if one fails then i have to roll back both the transactions.
Here i am dealing with a database transaction and a camel transaction.

If any of one fails i have to roll back both the transactions there is
nothing mentioned about rolling back both database transaction and camel
transaction at a time in that article.






--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-XA-transaction-tp5770836p5770855.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Apache Camel XA transaction

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can read about transactions here
http://camel.apache.org/transactional-client.html

On Thu, Aug 20, 2015 at 5:02 AM, kishoreJ <ki...@gmail.com> wrote:
>  have to send a message to an endpoint using camel and at the same time if
> the message is sent successfull then i have to update the database ..
>
> These two steps should be done in a single transaction
>
> Now i have to roll back the camel message if there is any exception in
> updating the database or i have to roll back db transaction if there is any
> exception in sending the message.
>
> so i have to either send both at the same time or if there is any exception
> in one case then i have to rollback both at the same time.
>
> Does anyone have any clue?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-XA-transaction-tp5770836.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2