Hi Hari,

If you want to send the message to a http endpoint , you could set routing
address to be "direct:tohttp" and set the message header with

.setHeader(org.apache.camel.component.http.HttpProducer.HTTP_URI,
constant("http://newhost";))

then you can get what you want.

BTW, the HTTP_URI header was just added into the Camel 1.5.1.*

*Willem*
*
On Sat, Nov 15, 2008 at 5:10 AM, harinair <[EMAIL PROTECTED]> wrote:

>
> Claus:
>
> Thanks for the reply... I would not have much control since I use dynamic
> routing address by recipientList. Probably to refresh WSSE for every retry,
> I may have to modify the HTTP component??? Is there no other way to
> introduce some kind of send filter on the component so that I can get the
> control before each send? Probably not possible - right?
>
> Regards.
> Hari Gangadharan
>
>
>
> Claus Ibsen wrote:
> >
> > Hi
> >
> > You could send it to a direct endpoint and then you can set the header
> > before sending it to the real http endpoint.
> >
> > Something like this - where we use a POJO to compute the header value:
> >
> >
> from("direct:tohttp").setHeader("wsse").bean(MySetHeaderBean.class).to("http:xxxx")
> >
> > You can also use the simple language to set the date and a constant text.
> > Maybe that is sufficient for your requirement:
> >
> > from("direct:tohttp").setHeader("wsse").simple("${date:now:YYYY-mm-dd}
> > Hello World").to("http:xxxx")
> >
> >
> >
> > Oh the problem with setting on retries is a bit more cumbersome; you can
> > use a POJO to send it so you can be in full power, where you set the
> > updated header.
> >
> > from("direct:tohttp").to("bean:sendtohttp");
> >
> > And in the POJO sendtohttp you set the new updated header.
> > Then Camel will handle retry and invoke you bean for each retry where you
> > set a fresh updated header.
> >
> >
> >
> > Med venlig hilsen
> >
> > Claus Ibsen
> > ......................................
> > Silverbullet
> > Skovsgårdsvænget 21
> > 8362 Hørning
> > Tlf. +45 2962 7576
> > Web: www.silverbullet.dk
> > -----Original Message-----
> > From: harinair [mailto:[EMAIL PROTECTED]
> > Sent: 10. november 2008 05:30
> > To: camel-user@activemq.apache.org
> > Subject: Setting HTTP headers before send
> >
> >
> > Hi All:
> >
> > I use the recipientList to send to different endpoints like ftp/sftp/http
> > depending on the header route.  I have a requirement of setting the
> > headers
> > before the send - especially the WSSE headers that contains a unique
> nonce
> > and the created date. I have to set this every time the HTTP endpoint or
> > any
> > endpoint try to send it - even on retries I have to modify these headers.
> > Is
> > there any easy way to do this?
> >
> > Any help will be greatly appreciated.
> > Hari Gangadharan
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/Setting-HTTP-headers-before-send-tp20414207s22882p20414207.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Setting-HTTP-headers-before-send-tp20414207s22882p20508355.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>

Reply via email to