Skip to main content

Use Component Specific Headers

Some components like cHTTP are aware of specific header fields (e.g. org.apache.camel.Exchange.HTTP_PATH). If such a header is set, this header will overwrite the default configuration of the component itself. This is quite helpful, if you can set a specific value at runtime only. If you use such a component specific header, set this header to your required value just before calling your component, and set this header to null right after that component.

If you don't do this, calling a similar component again later in the Route (or within a subRoute) could cause unexpected behaviour. To avoid the burden for each subRoute to test whether or not any component specific header values are set, just remember to always reset these types of header values, right after they have been used.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!