Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 9966 invoked from network); 14 Aug 2009 01:39:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Aug 2009 01:39:27 -0000 Received: (qmail 38468 invoked by uid 500); 14 Aug 2009 01:39:32 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 38412 invoked by uid 500); 14 Aug 2009 01:39:31 -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 38402 invoked by uid 99); 14 Aug 2009 01:39:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2009 01:39:31 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.216.195 as permitted sender) Received: from [209.85.216.195] (HELO mail-px0-f195.google.com) (209.85.216.195) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2009 01:39:19 +0000 Received: by pxi33 with SMTP id 33so154668pxi.11 for ; Thu, 13 Aug 2009 18:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=VAcKsXsU1PL8txywm5DKcgHy2JsWLhQNROENq0aXT0s=; b=uQhYnZkb5eVGiFNpaKSU7Md8ls8xuvQ5+3wJ2U+GhBM35DpuvPRRfvYbLWSqamgAhC LZIposzOvfiQI4GXzVmcpUPwdnMNWXXF+WLrErU5M6tCjwUb0G1gATzUoS/GiClgdjhM L2PquG4hLPYDpZJJH4MxVJMZtsZmiwuRKNjhY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=PIEf2c0ASp6+l5wUxpRJyj8EOwYkOaFF++sZxXMkiDH1GUM/XlSBbY1FGRXv859Q5T 1XpmngD7eNr7j6lBX+cvMxDkwdd4J5ihDjCLj3HrNqdr8hh/YG2PATw2Zwd4hKKzBlW2 6JHD6fyCt/vZXZiGHSrdOlcdpUfrfaX7dEntU= Received: by 10.140.187.11 with SMTP id k11mr786295rvf.105.1250213939555; Thu, 13 Aug 2009 18:38:59 -0700 (PDT) Received: from ?192.168.0.158? ([221.223.252.77]) by mx.google.com with ESMTPS id b39sm3016791rvf.48.2009.08.13.18.38.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 Aug 2009 18:38:58 -0700 (PDT) Message-ID: <4A84C02E.40003@gmail.com> Date: Fri, 14 Aug 2009 09:38:54 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: What to do with HTTP response when route from HTTP to JMS? References: <24924548.post@talk.nabble.com> <4A825115.80707@gmail.com> <24940755.post@talk.nabble.com> <5380c69c0908130004r2b374912w91fee41844fedd7e@mail.gmail.com> <24956371.post@talk.nabble.com> In-Reply-To: <24956371.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, If camel can't send the JMS message into the jms queue, it will throw the exception , and camel will use the default error handler[1] (which will try to redeliver the message few times) to deal with this error, then the jetty consumer can get the error and send back an error message to the client. So If you just want to send the OK message back to the jetty endpoint, you may need to the work like this from("jetty:http://localhost:9080/myapp/myservice") .process(new Processor() {...}) // set the exchange pattern, since there is no response from jms queue .inOnly() .to("jms:queue:some_queue") // set the out message for jetty consumer to send back to client .inOut().setBody(constant("OK")); [1]http://camel.apache.org/error-handler.html Willem janylj wrote: > I don't think it works. My exact route is: > > from("jetty:http://localhost:9080/myapp/myservice") > .process(new Processor() {...}) > .to("jms:queue:some_queue") > .to("http://localhost:9080/myapp/myservice"); > > I still got the error said, > org.apache.camel.ExchangeTimedOutException: The OUT message was not received > within: 20000 millis on the exchange: > > Basically I would like my starting endpoint receive 200 status ok when send > jms successfully or 500 error when send jms failed. How to do that? > > Thanks a lot. > > > Claus Ibsen-2 wrote: >> On Wed, Aug 12, 2009 at 7:01 PM, janylj wrote: >>> Thanks a lot, Willem. It works using inOnly() >>> >>> willem.jiang wrote: >>>> from("jetty ....").process(...).inOnly().to("jms:queue") >>>> >>> How to make it send a HttpResponse only if sending JMS message is >>> successfully. I tried to list the same jetty endpoint in the end, but it >>> doesn't work. Please advise. Thanks again. >>> >>> from("jetty ....").process(...).to("jms:queue").to("jetty....") >>> >> jetty is only used as a consumer, eg you can only use it in the from node. >> So when you want to call some external HTTP service use the http >> component instead >> >> from(jetty).to(http) = OK >> >> from(jetty).to(jetty) = NO OK >> >> >>> -- >>> View this message in context: >>> http://www.nabble.com/What-to-do-with-HTTP-response-when-route-from-HTTP-to-JMS--tp24924548p24940755.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> >