Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 54ABE10E87 for ; Tue, 14 Jan 2014 07:55:21 +0000 (UTC) Received: (qmail 32339 invoked by uid 500); 14 Jan 2014 07:54:08 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 32298 invoked by uid 500); 14 Jan 2014 07:54:05 -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 32273 invoked by uid 99); 14 Jan 2014 07:54:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 07:54:04 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sanjbh@gmail.com designates 209.85.215.54 as permitted sender) Received: from [209.85.215.54] (HELO mail-la0-f54.google.com) (209.85.215.54) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jan 2014 07:53:59 +0000 Received: by mail-la0-f54.google.com with SMTP id y1so28190lam.27 for ; Mon, 13 Jan 2014 23:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RiXdmQaYEWw9bYs0styQaUZmDfwyIyhynJqVvXGabxg=; b=AW9th1yH7Nm0cxvrAOTEBPTEBqKJulTRIMIG3RoDjLTczHJlQK37PW0p2jaLDhKarO 41vGlZM0j2DXz2ETQcOgx66KDUpZTawARRJ59lLk7HTIqTcPUX6z5euDvHZ2PVC/U6xw mJwse4VTI3/ECX/JU5A22aw+VD3inmfiNSHBV/46pWhIZ3hFiBOONbmvIsfTAmwCTzaD tV/BHKf21ypNOVIpix5GOD6yoNwXn8g5cDrOmU3eDPZz5GDPEAQ3IJh1+Kr/1dY3MlYx A/LSQ7lLc3Pi1ke1CrSbwIUOf8J4OOC3+qfgDvwyrolxmwa8U458laiRHBK1O5KFa5I1 azCg== MIME-Version: 1.0 X-Received: by 10.112.201.167 with SMTP id kb7mr70962lbc.32.1389686018146; Mon, 13 Jan 2014 23:53:38 -0800 (PST) Received: by 10.112.181.9 with HTTP; Mon, 13 Jan 2014 23:53:38 -0800 (PST) In-Reply-To: <1389656691448-5745913.post@n5.nabble.com> References: <1389656691448-5745913.post@n5.nabble.com> Date: Tue, 14 Jan 2014 13:23:38 +0530 Message-ID: Subject: Re: How to retrieve the Exchange from onMessage of an MDB From: Sanjay Bhattacharya To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001a11c25896760a8f04efe97d08 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c25896760a8f04efe97d08 Content-Type: text/plain; charset=ISO-8859-1 Instead of an MDB, you can use a bean to process the message. ... And you can define processMessage as: public void processMessage(String body, Exchange exchange) { try { //do your stuff } catch(Exception e) { exchange.getContext().stopRoute("yourRouteId"); } Thanks, Sanjay On Tue, Jan 14, 2014 at 5:14 AM, hooty223 wrote: > I have an MDB that calls a function when an error occurs (program errors > and > not Runtime). When this occurs I would like to stop the route. How can I do > this since the Exchange is not available on the onMessage(Message message) > call. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-retrieve-the-Exchange-from-onMessage-of-an-MDB-tp5745913.html > Sent from the Camel - Users mailing list archive at Nabble.com. > --001a11c25896760a8f04efe97d08--