Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 64588 invoked from network); 25 Aug 2009 15:50:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Aug 2009 15:50:50 -0000 Received: (qmail 30818 invoked by uid 500); 25 Aug 2009 15:51:15 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 30775 invoked by uid 500); 25 Aug 2009 15:51:15 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 30764 invoked by uid 99); 25 Aug 2009 15:51:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 15:51:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.220.216 as permitted sender) Received: from [209.85.220.216] (HELO mail-fx0-f216.google.com) (209.85.220.216) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 15:51:03 +0000 Received: by fxm12 with SMTP id 12so2338685fxm.20 for ; Tue, 25 Aug 2009 08:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=YAFYoGT4vYY5mSdcLcEEZaSIKtHkJlruR/5phuWAZRg=; b=a+kbSf+qqpGLNUx76MpGOT1nMpr9AJo+aeC18v5VW/NOogXbBmxRxKeuwEKXHYltgA ygosWgYqXcRjDItOSsPa0xYdKogPS6bZ+V01w6GJ7geqwTjiEpoM24oqSfPg4/8u1C+m CZRBk1c2T2URjBd3j/bYGSrW6E+xILcGuafr8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=oiRBr56BPVLDyuZMrerVN3O0lYusMCaiyUx9j9K0r4eSlJHOoop1V4ObGlzm1Gx/WE 0PUoCr+WgRTteiCRxN4MH8YLA7KHDi5p2GodF4KUb4ohDOW0jL/6SkOzQKBSX/7vUlFL TXRfd+1ND/N6x20Chv3nZySjrgOZ54+WgXXVI= MIME-Version: 1.0 Received: by 10.204.10.18 with SMTP id n18mr2629312bkn.98.1251215443202; Tue, 25 Aug 2009 08:50:43 -0700 (PDT) In-Reply-To: <1073b09c0908250847g5196a667x841dfbd4bbae87d6@mail.gmail.com> References: <1073b09c0908241655q70bc3bd2t6e4c99864952f370@mail.gmail.com> <5380c69c0908242249l70d12b51he9a0d5665648696b@mail.gmail.com> <1073b09c0908250847g5196a667x841dfbd4bbae87d6@mail.gmail.com> From: Claus Ibsen Date: Tue, 25 Aug 2009 17:50:23 +0200 Message-ID: <5380c69c0908250850s72afe49enb5efb7eda16f389c@mail.gmail.com> Subject: Re: JMS transactions between multiple routes To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org See transferException option on Camel JMS On Tue, Aug 25, 2009 at 5:47 PM, Ilya S wrote: > Hi Claus, > > Yes, I believe I am using request/reply over JMS. > > Is there a way to ask Camel to commit a TX at some point in my route? > > I just sent a clarification on what I'm actually trying to accomplish: > if some endpoint in the middle failed, I would the the error to be > propagated back to the original producer, and I was hoping that this > can be done. > > Thank you. > > On Mon, Aug 24, 2009 at 10:49 PM, Claus Ibsen wrot= e: >> Hi >> >> Are you doing request/reply over JMS and want to do that with transactio= ns? >> If so that is not possible as messages are not commited to the JMS >> queue before the TX is comitted. >> >> >> >> On Tue, Aug 25, 2009 at 1:55 AM, Ilya S wrote: >>> Hi All, >>> >>> I'm using Camel 1.6.1 (cannot use 2.0) , with Spring 2.5.6, and ActiveM= Q 5.2. >>> >>> I'm trying to set up Transaction Manager so that my transactions are >>> rolled back on error. >>> Here is my camel xml config adopted from the examples: >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> =A0 =A0 >>> >>> =A0 =A0 >>> =A0 =A0 =A0 =A0org.apache.camel.example.server >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 >>> >>> =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 >>> >>> =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 >>> >>> =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> >>> =A0 =A0 =A0 =A0>> class=3D"org.apache.activemq.ActiveMQConnectionFactory"> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> >>> =A0 =A0 =A0 =A0>> class=3D"org.springframework.jms.connection.JmsTransactionManager"> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> >>> =A0 =A0 =A0 =A0>> class=3D"org.springframework.transaction.support.TransactionTemplate"> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> >>> =A0 =A0 =A0 =A0>> class=3D"org.apache.camel.spring.spi.TransactionErrorHandlerBuilder"> >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >>> =A0 =A0 =A0 =A0 >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> I have 2 routes. >>> Route 1 (extends from SpringRouteBuilder) >>> >>> =A0 =A0 =A0 =A0TransactionTemplate template =3D >>> bean(org.springframework.transaction.support.TransactionTemplate.class, >>> "PROPAGATION_REQUIRED"); >>> =A0 =A0 =A0 =A0Policy pp =3D new >>> SpringTransactionPolicy(template); >>> >>> =A0 =A0 =A0 =A0from("jms:queue:numbers") >>> =A0 =A0 =A0 =A0.policy(pp) >>> =A0 =A0 =A0 =A0.to("jms:queue:mybadqueue?transactedInOut=3Dtrue") >>> =A0 =A0 =A0 =A0.to("multiplier"); >>> >>> >>> Route 2: >>> =A0 =A0 =A0 =A0from("jms:queue:mybadqueue") >>> =A0 =A0 =A0 =A0.process(new Processor() { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0public void process(Exch= ange arg0) throws Exception { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw ne= w Exception("Hello World Exception"); >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >>> >>> =A0 =A0 =A0 =A0}) >>> =A0 =A0 =A0 .to("multiplier"); >>> >>> >>> With this configuration I never get messages sent to "jms:queue:mybadqu= eue". >>> Could someone point me in the right direction? Please, advise. >>> >>> Thank you. >>> Ilya. >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus