Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 97030 invoked from network); 17 Oct 2009 06:18:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Oct 2009 06:18:14 -0000 Received: (qmail 81963 invoked by uid 500); 17 Oct 2009 06:18:13 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 81924 invoked by uid 500); 17 Oct 2009 06:18:13 -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 81912 invoked by uid 99); 17 Oct 2009 06:18:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Oct 2009 06:18:13 +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.207 as permitted sender) Received: from [209.85.220.207] (HELO mail-fx0-f207.google.com) (209.85.220.207) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Oct 2009 06:18:02 +0000 Received: by fxm3 with SMTP id 3so1870851fxm.20 for ; Fri, 16 Oct 2009 23:17:42 -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=TqnGZi5+aztsIgYDl8rTRILxbFYa6tSh/2UkHZ4Cmdk=; b=r/L1X70+CkLSVB0jtLBEJaQHcjIbT+gRLp7jNZn55Xev4uY0rOnoBH2kASuK1313vL kZXFzz4XITxd1WFZn0mXzp/IEzpOebV40iBpWFMXqi04EM5tET7/7n1Mzf6BLVXe1Kp0 tOu7dzaNH3uCFGJ2X/UPgCIFI5vlJS8tlg7MQ= 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=eOtZJ/xhb51EhrJer4+pvbxVH4Wn9jAFXW52JlFLS1Qg3zu6HD44FpMjAV5QY7pv8E 4EKAWESFKQFpgZiAE+3yTWGG3hX5yvbOspbZIOkLnmmeQjAcPnIxKrZVlG4rvuMuqk9S HPmneoVPOn1iSwUodLj7YxQFF13Whh2eDaem8= MIME-Version: 1.0 Received: by 10.204.156.24 with SMTP id u24mr2155058bkw.172.1255760262137; Fri, 16 Oct 2009 23:17:42 -0700 (PDT) In-Reply-To: <25933965.post@talk.nabble.com> References: <25933807.post@talk.nabble.com> <25933965.post@talk.nabble.com> From: Claus Ibsen Date: Sat, 17 Oct 2009 08:17:22 +0200 Message-ID: <5380c69c0910162317w3f9e01bfnd5338b80f940a6fb@mail.gmail.com> Subject: Re: Best way to throw away an exchange in a route in an otherwise() case 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 On Sat, Oct 17, 2009 at 2:02 AM, jonathanq wrote: > > I think I found the solution in the documentation (that's what I get for > finally posting a question - never fails I will find the answer 10 minute= s > later). > > This is waht I have now: > > from("direct:incoming") > =A0 =A0 =A0 =A0 =A0 =A0.choice() > =A0 =A0 =A0 =A0 =A0 =A0 =A0.when(header("status").isEqualTo("1")) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.process(status1processor) > =A0 =A0 =A0 =A0 =A0 =A0 =A0.when(header("status").isEqualTo("2)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.process(status2processor) > =A0 =A0 =A0 =A0 =A0 =A0 =A0.otherwise().process(unknownstatusprocessor).s= top() > =A0 =A0 =A0 =A0 =A0 =A0.end() > =A0 =A0 =A0 =A0 =A0 =A0.process(someOtherProcessor) > =A0 =A0 =A0 =A0 =A0 =A0.to("mock:outgoing); > > Specifically - I added the .stop() to the otherwise() path. > > .otherwise().process(getUnknownEmailStatusProcessor()).stop() > > Is that the correct way to do it? =A0My unit tests seem to say so..but I > wanted to ask the experts to be sure. Yeah stop() is the right way to do so. Its also easy to understand what it does :) The message filter is another way (a more classic EIP solution) http://camel.apache.org/message-filter.html > -- > View this message in context: http://www.nabble.com/Best-way-to-throw-awa= y-an-exchange-in-a-route-in-an-otherwise%28%29-case-tp25933807p25933965.htm= l > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus