Remove Header

The Remove Header EIP allows you to remove a single header from the Message.

Options

The Remove Header eip supports 2 options, which are listed below.

Name Description Default Type

description

Sets the description of this node.

String

disabled

Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.

false

Boolean

name

Required Name of header to remove.

String

Example

We want to remove a header with key "myHeader" from the message:

  • Java

  • XML

  • YAML

from("seda:b")
  .removeHeader("myHeader")
  .to("mock:result");
<route>
  <from uri="seda:b"/>
  <removeHeader name="myHeader"/>
  <to uri="mock:result"/>
</route>
- from:
    uri: seda:b
    steps:
      - removeHeader:
          name: myHeader
      - to:
          uri: mock:result

See Also

Camel provides the following EIPs for removing headers or exchange properties: