Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 54651 invoked from network); 21 Feb 2011 17:09:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Feb 2011 17:09:53 -0000 Received: (qmail 31778 invoked by uid 500); 21 Feb 2011 17:09:53 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 31600 invoked by uid 500); 21 Feb 2011 17:09:50 -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 31592 invoked by uid 99); 21 Feb 2011 17:09:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Feb 2011 17:09:49 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of marco.zapletal@gmail.com designates 209.85.214.50 as permitted sender) Received: from [209.85.214.50] (HELO mail-bw0-f50.google.com) (209.85.214.50) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Feb 2011 17:09:39 +0000 Received: by bwz2 with SMTP id 2so1244530bwz.23 for ; Mon, 21 Feb 2011 09:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:subject:content-type:content-transfer-encoding; bh=FnRr+5Xoqnbe6CnVs00n8qFAM6R1qBOyGBxtLZz8vvs=; b=n/gOLDPicFZgPuiiVG7Ifl4PQ8gzNSSNWqQE/ZKg49EiyrKw3atoeBPhhJx/M9cKlg 82qhuElf9sbSOMsMtxBUHR4GE5l6kl/fjDMQsUyFN+IvNwBmPgYTyom/2PcFsdZRptJp 8XCRfxcOKZ9GbegGfyQ5JPzBwQC1Q1z4l0mu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=ZIdDSeubrFZePhQ4t5gL0N6rmAMf24x3cKd+wHCwEhvV8EIvahpkUqsaKrQKo7SX3v T0cjBC3aNpxH5QQEpbk+AGTyBsqUyERPpe+lDbfcdabRfIw+xo2flDArVZmsOj9SyZCe 8CHjDpsJKwAqGMPJSk56B7hZfHUijuMvJnQYk= Received: by 10.204.126.99 with SMTP id b35mr1550945bks.168.1298308159036; Mon, 21 Feb 2011 09:09:19 -0800 (PST) Received: from [192.168.168.217] (fortinat.ifs.tuwien.ac.at [128.131.167.8]) by mx.google.com with ESMTPS id j11sm3864349bka.0.2011.02.21.09.09.18 (version=SSLv3 cipher=OTHER); Mon, 21 Feb 2011 09:09:18 -0800 (PST) Sender: Marco Zapletal Message-ID: <4D629C3D.7020309@gmail.com> Date: Mon, 21 Feb 2011 18:09:17 +0100 From: Marco Zapletal User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: users@camel.apache.org Subject: Returning a custom response (custom fault message) when a transaction fails Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Dear folks, My questions relates to a transacted route as it is described in the Camel in Action Book in Section 9.4.3 (Returning a custom response) - my goal is, however, to return a web service fault (instead of regular response message) _and_ rollback the route. The situation is as follows: I have a transacted camel route exposed as a web service. In case, an exception happens on the route, the exception is caught using an onException block and a custom response is returned. My transaction handling behavior looks quite similar as in the book: java.lang.Exception true However, I do not want to return a "regular response message" containing an error code, but a web service fault. I am doing this using code as follows in my corresponding bean: exchange.getOut().setBody(new Failure(...)); // my JAXB fault type exchange.getOut().setFault(true); My problem is now that when calling setFault(true) on the out messsage the transaction is not rolled back according to the logs (DEBUG:Transaction commit (0x2b105d) for ExchangeId: ID-4711) When I return a regular out message, everything works as expected and I see in the logs that the transaction is rolled back. I've already tried to use just rollback() instead of markRollbackOnly(), but without any success. Any help would be appreciated. Thanks, marco