Set Context
Set Context is used to add a header to the message or to define a property or to change the content of the message. When adding a Header or Property, it is important to specify the value type. While the Constant option is used to add a fixed value, the Expression option is used to get the value from Camel Exchange, XPath from XML, Header from message headers, Property from message properties, and JSONPath from JSON.
If header is defined with Set Context, these values are added as HTTP Header.
If property is defined, this becomes the variable defined during the whole flow. After the property is defined, it can be used as ${exchangeProperty.propertyName} in connectors.
If a value is written in the Body textarea section in the Change Context tab, the current input is the value written in this field. The value written in this field can be defined as expression. If you want to change the value with expression, the Use Simple Query box should be checked.
Parameters of Context Header;
| Field | Description |
|---|---|
| Name | Name of header. |
| Type | Constant/XPath/JSONPath/Expression/Header/Property |
| Value | It depends on header type. |
Parameters of Context Property;
| Field | Description |
|---|---|
| Name | Name of property. |
| Type | Constant/XPath/JSONPath/Expression/Header/Property |
| Value | It depends on property type. |
Parameters of Change Context;
| Field | Description |
|---|---|
| Use Simple Query | If it is wanted to change the body with expression, it should be checked. |
| Body | Body value. If Use Simple Query checked, Constant and Expression values can be used together. Example : name is : ${exchangeProperty.name} |