[
https://issues.apache.org/jira/browse/CAMEL-3429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971931#action_12971931
]
Hadrian Zbarcea commented on CAMEL-3429:
----------------------------------------
That would be an idea, however I assume you meant {{remove}} instead of
{{removeHeaders}}
{code}
from("...").headers().remove("x").to("...")
from("...").headers().remove("x", "y", "z").to("...")
{code}
There are a few people in the community now that think we could improve the
DSL. Martin tweeted about his recent dabbling with a Scala dsl. I would like to
see a more pluggable dsl and maybe a dsl builder, kinda the the way camel-bam
does it, to better address integration needs of a specific industry or
organization. (Of course we strive to be backwards compatible too).
So anyway, I hope we'll tackle this one soon, I assume right after the holidays.
> Extend DSL with more header filtering constructs
> ------------------------------------------------
>
> Key: CAMEL-3429
> URL: https://issues.apache.org/jira/browse/CAMEL-3429
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Affects Versions: 2.5.0
> Reporter: Richard Kettelerij
> Fix For: Future
>
> Attachments: remove-headers-camel-core.patch
>
>
> Currently the DSL offers the following methods:
> - {{removeHeader(name)}} which removes a single header
> - {{removeHeaders(pattern)}} remove one or more headers based on a pattern
> (since 2.3)
> The attached patch extends the DSL with the following methods:
> - {{removeHeaders(name...)}} removes the headers in the given a vararg
> parameter.
> - {{removeHeadersExcept(pattern)}} removes all headers except for the ones
> matching the given pattern (opposite of {{removeHeaders(pattern)}})
> - {{removeHeadersExcept(name...)}} removes all headers except for the ones in
> the given vararg parameter (opposite of {{removeHeaders(name)}})
> The rationale for the removeHeadersExcept() method is that in many cases you
> want to take a _defensive_ approach with regard to header propagation.
> Sometimes you may want to remove _every_ header on the current message, in
> that case just call removeHeadersExcept() with no arguments.
> In other cases you want to propagate only the "id" header received through
> the servlet/jetty component (as a query parameter). In that case call
> removeHeadersExcept("id") to preserve the "id" header, while preventing other
> query parameters (and standard HTTP headers) to flow down your route.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.