Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 98617 invoked from network); 21 Jan 2010 00:52:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jan 2010 00:52:09 -0000 Received: (qmail 27605 invoked by uid 500); 21 Jan 2010 00:52:09 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 27583 invoked by uid 500); 21 Jan 2010 00:52:09 -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 27573 invoked by uid 99); 21 Jan 2010 00:52:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2010 00:52:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.217.214 as permitted sender) Received: from [209.85.217.214] (HELO mail-gx0-f214.google.com) (209.85.217.214) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2010 00:51:59 +0000 Received: by gxk6 with SMTP id 6so4247944gxk.13 for ; Wed, 20 Jan 2010 16:51:38 -0800 (PST) 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=raBrEx+drP25VuWx12oiEhm9L/L47SVAvQsg5zTcY5s=; b=fJu810S5AvVeIaDYf+Kw3Eef6ah1EiV6GZdnc7DXlFufVxsBs/I8Qp2dH3bbAsXwOr Izmi1r3t75H3Ljk1fJJedu/J+PL5zohb14bvuLFn648KhOGUTX+35AKcPCacOmu0F+QN GH4Z+wbyrgh1XBVRksBdzSTXIPvSv4RJQlSeM= 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=pNBp8B4HH2pkjzFXKQpEiNPufm7Wo3Y5pI+xYTO/+SCoTIyKeTo2vbZQ5cc3Bzb1qN Nnl+IIiq6/8OyVJyrZboCUqWLjTCbBUXmzdptgaQRnrY+FQpMzpsbRlMkRGVT8K7kzzK RAoYA5+Q7dyhWwhYVdakgrt4uc98Pc5ZSNG3A= Received: by 10.90.40.4 with SMTP id n4mr850770agn.44.1264035098459; Wed, 20 Jan 2010 16:51:38 -0800 (PST) Received: from ?192.168.0.158? ([125.34.8.41]) by mx.google.com with ESMTPS id 15sm280771gxk.0.2010.01.20.16.51.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 20 Jan 2010 16:51:36 -0800 (PST) Message-ID: <4B57A514.3030401@gmail.com> Date: Thu, 21 Jan 2010 08:51:32 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: passing the HTTPServletRequest from Jetty to a SEDA consumer in Spring DSL References: <270858e91001200102v1c40e191o1da3e52907602036@mail.gmail.com> <270858e91001200140m25098594h627758dc5712e765@mail.gmail.com> <4B57210D.7040300@gmail.com> <270858e91001200816y7f9bd106sb8b4ef60735a385a@mail.gmail.com> In-Reply-To: <270858e91001200816y7f9bd106sb8b4ef60735a385a@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Wayne Keenan wrote: > Hi, > > Thanks for replying. > > On Wed, Jan 20, 2010 at 3:28 PM, Willem Jiang wrote: > >> Hi, >> >> Can you try to set the ID into the message header instead of the message >> body ? In this way you can the Request object back :) >> >> >>>> >>>> >>>> >>>> >>>> ${id} >>>> >>>> >>>> >>>> >>>> >>>> >>>> >> You bean's method could >> public String controller(@Header("id")String body, Exchange exchange) ; >> >> >> > The request body contains base64 encoded POST I want. > > I can get to the body, url paramters and the ID ok without the intermediate > SEDA route, in the bean I have: > > > HttpServletRequest req = > exchange.getIn().getBody(HttpServletRequest.class); > > def corrId = exchange.getIn().getMessageId() It looks the seda endpoint didn't copy the message body of the HttpServletRequest. I will write a simple unit test to verify it. > > I also can get to the URL (not form encoded) parameters (e.g. the URL is: > http://0.0.0.0:65503/endpoint?myParam=value) by using: > > def p1 = req?.getParameter('myParam') > > > > It's ony when I introduce the SEDA that the HttpServletRequest no longer > exists, (I think), and I am unable to obtain the HTTP parameters from the > URL > > Perhaps I should be copying the HTTP parameters to Camel message > properties? That way my bean can be less dependent on the HTTP protocol. Yes, that could be another solution. > > Is that something someone would be able to give me an example of please? Is > there a built-in way to auto populate Camel message properties with HTTP > properties > > Alternatively, sticking with HTTP aware bean,I just get null using: > > println exchange.getProperty(Exchange.HTTP_QUERY) > or > println exchange.getIn().getProperty(Exchange.HTTP_QUERY) > The HTTP_QUERY is a message header. You can get it like this exchange.getIn().getHeader(Exchange.HTTP_QUERY) > > > Regards > Wayne > Willem