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 20C4BC7AA for ; Thu, 5 Jun 2014 14:40:56 +0000 (UTC) Received: (qmail 94649 invoked by uid 500); 5 Jun 2014 14:40:55 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 94605 invoked by uid 500); 5 Jun 2014 14:40:55 -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 94593 invoked by uid 99); 5 Jun 2014 14:40:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2014 14:40:55 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jlrodrigues.dev@gmail.com designates 209.85.214.181 as permitted sender) Received: from [209.85.214.181] (HELO mail-ob0-f181.google.com) (209.85.214.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2014 14:40:50 +0000 Received: by mail-ob0-f181.google.com with SMTP id wm4so1184845obc.26 for ; Thu, 05 Jun 2014 07:40:29 -0700 (PDT) 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=ODXzmxOEgvTSfsz/VLHoHzCwxtLtNy5JBYjeDmaibXM=; b=Tx3i44eYSbsnJgEnU9Kjr5xtdA5cgIRTQGOqz0S0ZqXnNPCOx2QfVhUI3IKrDzjg9X oe8CJvl0Omo7JZhwrVgEsm/HACSHIBCipIJmuImc7dAtZEmtA47EjCodu5LMgtwdi4JQ 4rd0s5y1m4U1Na+3zKwlQsr7kvosCWzDmy4osRpFl4M8YtEyBnw2jykKQ4P+3nd4Bmn7 8dxCZxs7ras3TkvGm4Hrf9xTOqwbIS+rZ9b6Mq+qpRmHUcPjAJkBuFOAt3e65dar8G2i 2HRXrdcBhfiWP8AhMO6mNVf+EVZbZxCqEh3qqJi5cUXcYbrtcOocIeC338Bf6EkWiQ2u bX4g== MIME-Version: 1.0 X-Received: by 10.60.133.107 with SMTP id pb11mr68196633oeb.48.1401979229142; Thu, 05 Jun 2014 07:40:29 -0700 (PDT) Received: by 10.182.65.168 with HTTP; Thu, 5 Jun 2014 07:40:29 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 Jun 2014 15:40:29 +0100 Message-ID: Subject: Re: AdviceWithRouteBuilder.weaveById() creates duplicated endpoint From: =?UTF-8?Q?Jo=C3=A3o_Rodrigues?= To: users@camel.apache.org Content-Type: multipart/alternative; boundary=047d7b4727f2efa51504fb17b931 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b4727f2efa51504fb17b931 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I've tried camel 2.13.0 and it shows the same symptoms. Thanks On Wed, Jun 4, 2014 at 11:59 PM, Jo=C3=A3o Rodrigues wrote: > I've noticed the weaveById() creates a duplicated endpoint if there's a > "choice" in my camel route. > I'm running camel 2.12.3 with java 1.7.0_55. > > I've built a test case to demonstrate this issue: > git clone https://github.com/joaocenoura/sandbox.git > mvn clean package -f sandbox/camel-weaving/pom.xml > > There are two junit test with the following routes: > GoodRouteTest > > from("direct:start").id("start") > .to("mock:checkpoint").id("checkpoint") > .to("mock:end").id("end"); > > > BadRouteTest > > from("direct:start").id("start") > .setHeader("hello", constant("world")) > .choice() > .when(header("hello").isEqualTo("world")) > .to("mock:checkpoint").id("checkpoint") > .endChoice() > .otherwise() > // this shouldn't be called > .to("mock:deadend").id("deadend") > .end() > .to("mock:end").id("end"); > > > The BadRouteTest just introduces the choice/when/otherwise. > The problem is when I add a AdviseWithRouteBuilder with > 'weaveById("checkpoint").before().to("mock:checkpoint.before");' it creat= es > 2 endpoints instead of one. I've noticed the logs of junit confirms that. > > Excerpt of GoodRouteTest logs: > 23:44:45,644 INFO - - AdviceWithTasks > - AdviceWith (checkpoint) : [To[mock:checkpoint]] --> before [pipeline -= > > [[To[mock:checkpoint.before]]]] > 23:44:45,644 INFO - - AdviceWithTasks > - AdviceWith (checkpoint) : [To[mock:checkpoint]] --> after [pipeline -> > [[To[mock:checkpoint.after]]]] > > Excerpt of BadRouteTest logs: > 23:44:45,740 INFO - - AdviceWithTasks > - AdviceWith (checkpoint) : [To[mock:checkpoint]] --> before [pipeline -= > > [[To[mock:checkpoint.before]]]] > 23:44:45,740 INFO - - AdviceWithTasks > - AdviceWith (checkpoint) : [To[mock:checkpoint]] --> before [pipeline -= > > [[To[mock:checkpoint.before]]]] > 23:44:45,740 INFO - - AdviceWithTasks > - AdviceWith (checkpoint) : [To[mock:checkpoint]] --> after [pipeline -> > [[To[mock:checkpoint.after]]]] > 23:44:45,740 INFO - - AdviceWithTasks > - AdviceWith (checkpoint) : [To[mock:checkpoint]] --> after [pipeline -> > [[To[mock:checkpoint.after]]]] > > > Is this a bug or am I doing something wrong? > --047d7b4727f2efa51504fb17b931--