You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by AHardy <al...@db.com> on 2009/03/13 13:08:18 UTC

How do I filter out unwanted header properties propergated in route

Apache Camel has been a revelation in componentising flow based applications.
Although getting started has been a hair pulling exercise at times..but
definitely rewarding. I have the following route defined

from("imap:mailhost").process(new
AttachmentProcessor).to("bean:translate").to("jms:queue:output")

When I inspect the JMS header of published message, it contains unwanted
properties propergated by camel from original email along with processing
involved in the route. Example

Properties={ to={String:user1@abc.com, user2@abc.com}
org_apache_camel_splitSize={Integer:43} precedence={String:list}
subject={String:Subject line from email}
org_apache_camel_MultiParameterArray={String:false}
from={String:user1@abc.com} org_apache_camel_splitCounter={Integer:12}

How do I prevent these internal headers being copied into JMS header?
-- 
View this message in context: http://www.nabble.com/How-do-I-filter-out-unwanted-header-properties-propergated-in-route-tp22495164p22495164.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How do I filter out unwanted header properties propergated in route

Posted by AHardy <al...@db.com>.
That make sense, thanks Claus


Claus Ibsen-2 wrote:
> 
> On Fri, Mar 13, 2009 at 1:08 PM, AHardy <al...@db.com> wrote:
>>
>> Apache Camel has been a revelation in componentising flow based
>> applications.
>> Although getting started has been a hair pulling exercise at times..but
>> definitely rewarding. I have the following route defined
>>
>> from("imap:mailhost").process(new
>> AttachmentProcessor).to("bean:translate").to("jms:queue:output")
>>
>> When I inspect the JMS header of published message, it contains unwanted
>> properties propergated by camel from original email along with processing
>> involved in the route. Example
>>
>> Properties={ to={String:user1@abc.com, user2@abc.com}
>> org_apache_camel_splitSize={Integer:43} precedence={String:list}
>> subject={String:Subject line from email}
>> org_apache_camel_MultiParameterArray={String:false}
>> from={String:user1@abc.com} org_apache_camel_splitCounter={Integer:12}
>>
>> How do I prevent these internal headers being copied into JMS header?
> If you need to remove a single header then there is a removeHeader DSL
> node.
> However since there are many you can use a processor or bean to do a
> bit of java code
> 
> eg to remove them all
> exchange.getIn().setHeaders(null);
> 
> You can also set a new HeaderFilterStrategy on your JMS endpoint that
> can do the filtering.
> 
> 
>> --
>> View this message in context:
>> http://www.nabble.com/How-do-I-filter-out-unwanted-header-properties-propergated-in-route-tp22495164p22495164.html
>> Sent from the Camel - Users (activemq) mailing list archive at
>> Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/How-do-I-filter-out-unwanted-header-properties-propergated-in-route-tp22495164p22539138.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: How do I filter out unwanted header properties propergated in route

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Mar 13, 2009 at 1:08 PM, AHardy <al...@db.com> wrote:
>
> Apache Camel has been a revelation in componentising flow based applications.
> Although getting started has been a hair pulling exercise at times..but
> definitely rewarding. I have the following route defined
>
> from("imap:mailhost").process(new
> AttachmentProcessor).to("bean:translate").to("jms:queue:output")
>
> When I inspect the JMS header of published message, it contains unwanted
> properties propergated by camel from original email along with processing
> involved in the route. Example
>
> Properties={ to={String:user1@abc.com, user2@abc.com}
> org_apache_camel_splitSize={Integer:43} precedence={String:list}
> subject={String:Subject line from email}
> org_apache_camel_MultiParameterArray={String:false}
> from={String:user1@abc.com} org_apache_camel_splitCounter={Integer:12}
>
> How do I prevent these internal headers being copied into JMS header?
If you need to remove a single header then there is a removeHeader DSL node.
However since there are many you can use a processor or bean to do a
bit of java code

eg to remove them all
exchange.getIn().setHeaders(null);

You can also set a new HeaderFilterStrategy on your JMS endpoint that
can do the filtering.


> --
> View this message in context: http://www.nabble.com/How-do-I-filter-out-unwanted-header-properties-propergated-in-route-tp22495164p22495164.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/