Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 29418 invoked from network); 23 Aug 2010 13:32:37 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Aug 2010 13:32:37 -0000 Received: (qmail 7726 invoked by uid 500); 23 Aug 2010 13:32:37 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 7422 invoked by uid 500); 23 Aug 2010 13:32:35 -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 7409 invoked by uid 99); 23 Aug 2010 13:32:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 13:32:34 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of senthilkumara20@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qw0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Aug 2010 13:32:28 +0000 Received: by qwh5 with SMTP id 5so4836723qwh.32 for ; Mon, 23 Aug 2010 06:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=9Y/cY7nP2wV1jDBHxNjcfhsR329KG8qJQkW1/F5wMPw=; b=eXwt9/P/R/++/RRUGN24norirRNXWarUuJomjGw/ePPfdLKAECTpWB1YbKzcD3TUWd 8vv16p6Zs9BoKdnglO5QfQmQsrggdt+AQIBfujPayjWOHbu38J8HvyS6qozTol1bAkCG iscrYwibwDIt4bkW7B42/+h6VF+mggD6EyWE0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=I6zC02V0ShacVS/WxMzb0xes5ghgS5V6HQ7NMs8iZcBNAogYyfoNHDkE/Ww93eUmgw jlHfHCpGrZg5O87gcSJP0y3B1Vm90d9rbmUHjHt4f6FORqtW01JnqX1pafWMZEpCf81Y cEw+TJrn6oRg1n5y1AgXbwhQxT09Ty+VlDnqU= MIME-Version: 1.0 Received: by 10.229.68.13 with SMTP id t13mr2545485qci.101.1282570322840; Mon, 23 Aug 2010 06:32:02 -0700 (PDT) Received: by 10.229.226.134 with HTTP; Mon, 23 Aug 2010 06:32:01 -0700 (PDT) In-Reply-To: <4C70D010.9060203@gmail.com> References: <1282442228367-2643569.post@n5.nabble.com> <4C70D010.9060203@gmail.com> Date: Mon, 23 Aug 2010 19:02:01 +0530 Message-ID: Subject: Re: Problem with consuming different types of message from same endpoint From: Senthilkumar Arumugam To: users@camel.apache.org Content-Type: multipart/alternative; boundary=0016e644d5507e7d9f048e7dacfd --0016e644d5507e7d9f048e7dacfd Content-Type: text/plain; charset=ISO-8859-1 Hi Willem, Thank you for your response. I could add filters and get it working for me. I have had to configure as below mentioned, to get it working for me. ${body.args[0]} is Foo The filter holds false for Exchange when I try checking the ${body} is Foo. It would be great to get directed, if there were anything incorrect I had done. Thanks, SK On Sun, Aug 22, 2010 at 12:51 PM, Willem Jiang wrote: > I don't know why you have two bean's saveOne method to call. > Do you want to call foo.saveOne if the message body is the instance of Foo > and call bar.saveOne if the message body is the instance of Bar? > > If so you can use the Content Base Router[1] to do it, and using Simple[2] > language to check the message body like this. > > > > > > > > ${body} is 'FOO' > > > > > ${body} is 'BAR' > > > > > > [1]http://camel.apache.org/content-based-router.html > [2]http://camel.apache.org/simple.html > > Willem > > senthil.arumugam wrote: > >> Hi, >> >> I am trying to consume message from an endpoint defined in my route. The >> queue to which the consumer is listening, has two different nature of >> messages. >> >> For eg, >> >> I have a queue, say "queue:one" which has messages of type Foo and Bar. >> When >> the consumer starts listening and on message, I am getting an exception >> with >> message like "Unable to convert body from Foo to Bar" >> >> I am using camel-spring for all my configuration. My routing in context >> file >> is, >> >> >> >> >> >> >> >> >> Thanks in advance. >> >> - SK >> > > --0016e644d5507e7d9f048e7dacfd--