You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fliot33 <fr...@poplidays.com> on 2015/06/08 12:09:35 UTC

HeaderFilterStrategy example

Hi,

I globbaly would like to do this :

<camelContext ...>
  <route>
    <from uri="activemq:test"/>
    <setHeader
headerName="SecretInformation"><simple>${body}</simple></setHeader>

    <setHeader
headerName="CamelHttpMethod"><constant>GET</constant></setHeader>
    <setHeader
headerName="Accept"><simple>text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</simple></setHeader>
    <setHeader
headerName="Accept-Language"><simple>fr,en-US;q=0.8,en;q=0.6,es;q=0.4</simple></setHeader>
    <to
uri="http://some-nice-remote-api/proc?HeaderFilterStrategy=z.mystrategy.myclass"/>
    
    <transform><simple>${header.SecretInformation}</simple></transform>
    <to uri="http://advise-passed"/>
  </route>
</camelContext>


Can you give me code example of HeaderFilterStrategy to avoid
header.SecretInformation to be send to "some-nice-remote-api",
But reamainging available in the current exchange ?

Thanks in advance,

Francois



--
View this message in context: http://camel.465427.n5.nabble.com/HeaderFilterStrategy-example-tp5767972.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: HeaderFilterStrategy example

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use an interceptFrom
http://camel.apache.org/intercept

On Mon, Jun 8, 2015 at 12:09 PM, fliot33 <fr...@poplidays.com> wrote:
> Hi,
>
> I globbaly would like to do this :
>
> <camelContext ...>
>   <route>
>     <from uri="activemq:test"/>
>     <setHeader
> headerName="SecretInformation"><simple>${body}</simple></setHeader>
>
>     <setHeader
> headerName="CamelHttpMethod"><constant>GET</constant></setHeader>
>     <setHeader
> headerName="Accept"><simple>text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</simple></setHeader>
>     <setHeader
> headerName="Accept-Language"><simple>fr,en-US;q=0.8,en;q=0.6,es;q=0.4</simple></setHeader>
>     <to
> uri="http://some-nice-remote-api/proc?HeaderFilterStrategy=z.mystrategy.myclass"/>
>
>     <transform><simple>${header.SecretInformation}</simple></transform>
>     <to uri="http://advise-passed"/>
>   </route>
> </camelContext>
>
>
> Can you give me code example of HeaderFilterStrategy to avoid
> header.SecretInformation to be send to "some-nice-remote-api",
> But reamainging available in the current exchange ?
>
> Thanks in advance,
>
> Francois
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/HeaderFilterStrategy-example-tp5767972.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/