Remove Header
The Remove Header EIP allows you to remove a single header from the Message.
Options
The Remove Header eip supports the following options which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
note | The note for this node. | String | |
description | The description for 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 |
Message Body
The message body at each side of the Remove Header EIP: EIP input is the body it needs, EIP output the body after it, and Steps the body its own steps start with.
| Side | Body | Description |
|---|---|---|
EIP output |
| Removes a header: the body stays as it was. |
The bodies are the ones with the default options. A side that is not listed is not known, and tooling does not guess it. The carriers, the sides and the tools that use them are described in Message Body Types.
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> - 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:
-
Remove Header: To remove a single header
-
Remove Headers: To remove one or more message headers
-
Remove Property: To remove a single exchange property
-
Remove Properties: To remove one or more exchange properties