Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 67799 invoked from network); 1 Aug 2007 16:16:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 16:16:09 -0000 Received: (qmail 58205 invoked by uid 500); 1 Aug 2007 16:16:09 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 58179 invoked by uid 500); 1 Aug 2007 16:16:09 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 58170 invoked by uid 99); 1 Aug 2007 16:16:09 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 09:16:09 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [65.216.251.45] (HELO exbah01.e-Space.local) (65.216.251.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 16:15:57 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7D457.34F46B19" Subject: Camel Pojo Routing Date: Wed, 1 Aug 2007 12:15:41 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Camel Pojo Routing Thread-Index: AcfUVzTMYTqdzm9VTbC9+oUblnOQhA== From: "Punnoose, Roshan" To: X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7D457.34F46B19 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I couldn't get the forums to come up, it keeps timing out, so I have to ask this question on the mailing list. =20 I have two Pojo endpoints, and I want to route based on a String input. How do I do that? This is my code currently: =20 CamelContext context =3D new DefaultCamelContext(); PojoComponent component1 =3D (PojoComponent) context.getComponent("pojo"); component1.addService("one", new PojoOne()); PojoComponent component2 =3D (PojoComponent) context.getComponent("pojo"); component2.addService("two", new PojoTwo()); =20 DirectComponent directComponent =3D (DirectComponent) context .getComponent("direct"); directComponent.createEndpoint("hello"); =20 context.addRoutes(new RouteBuilder() { public void configure() { FromBuilder from =3D from("direct:hello"); ChoiceBuilder choice =3D from.choice(); WhenBuilder when =3D choice =20 .when(body().isEqualTo("One")); when.to("pojo:one") =20 .otherwise().to("pojo:two"); } }); =20 context.start(); =20 Endpoint endpoint =3D context.getEndpoint("direct:hello"); PojoNumInterface pojo =3D (PojoNumInterface) PojoComponent.createProxy( endpoint, PojoNumInterface.class); pojo.execute("One"); =20 =20 I'm guessing the body() function only returns a PojoInvocation and not the actual argument "One". =20 Roshan ------_=_NextPart_001_01C7D457.34F46B19--