camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Ramkumar.I...@cognizant.com>
Subject RE: Transacting two web services - EIP?
Date Tue, 13 Nov 2012 17:09:46 GMT
I am not getting your question. Are both webservices part of a single transaction ? I.e do
you have one from clause and two to clauses? I am new to Camel. Hope below helps

Have you looked at http://camel.apache.org/transactionerrorhandler.html
And its features?

As the TransactionErrorHandler also supports to let Camel do redeliveries you can use both
worlds. Letting Camel do some redeliveries and at the end the backing transaction manager
doing other redeliveries. In fact in the end the transaction manager have the final word.
That means if Camel cannot process the exchange then its thrown back to the transaction manager
that will perform the rollback, and redelivery

Example with using Camel to do redeliveries:
In the route below we have configured a transaction error handler. It will by default do local
redeliveries up till 6 times. In Case Camel could not redeliver the message it will be thrown
back to the transaction manager that will do a rollback, and a redelivery if it was configured
to do so.
Notice that as we have all the powers from DefaultErrorHandler we can configure an onException
where we state that in case of this particular exception, an IllegalArgumentException we will
only do redeliveries up till 4 times. (Yes the code is based on an unit test).
And also notice that we mark the routes as transacted using transacted. This is always needed
to instruct Camel that these routes are transacted.
If you do not provide any Spring TransactionTemplate to either the transactionErrorHandler,
then Camel will automatic lookup in the Spring application context for a transaction manager
to use. See more in the Convention over configuration section on this page.

-----Original Message-----
From: dunnlow [mailto:dunnlow@yahoo.com]
Sent: Tuesday, November 13, 2012 10:05 PM
To: users@camel.apache.org
Subject: Transacting two web services - EIP?

Hello, I am using camel 2.9 and Spring 3.  I have a transacted route in which
I am pulling messages from a queue (activemq) and sending messages to two
web services (via multicast).  The web services are notification services
that send messages to users (there is no real roll back strategy - once the
notification is sent, it is sent).  When I only needed to send to one
service, things worked fine; if the service couldn't be reached for some
reason, then the transacted route would keep resending until successful.

The problem came up once I added a second web service.  Now if one web
service fails, the retry goes back to both services so the working services
keeps sending out notifications until the one that isn't working gets fixed.
Obviously, I'd like ONLY the broken service to keep retrying (pulling the
one that worked out of the transaction).

Is there a good/standard way to handle this in camel?  (Obviously I can
handle it myself outside camel, but am hoping for a camel/spring specific
solution)

Thanks for any ideas,
-J



--
View this message in context: http://camel.465427.n5.nabble.com/Transacting-two-web-services-EIP-tp5722673.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s)
and may contain confidential and privileged information. If you are not the intended recipient(s),
please reply to the sender and destroy all copies of the original message. Any unauthorized
review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or
any action taken in reliance on the contents of this e-mail is strictly prohibited and may
be unlawful.

Mime
View raw message