Set Property

The SetProperty EIP allows you to set a property on your exchange.

Options

The Set Property eip supports 1 options, which are listed below.

Name Description Default Type

expression

Required Expression to return the value of the message exchange property.

ExpressionDefinition

name

Required Name of exchange property to set a new value. The simple language can be used to define a dynamic evaluated exchange property name to be used. Otherwise a constant name will be used.

String

description

Sets the description of this node.

DescriptionDefinition

Examples

The following example shows how to use the SetProperty EIP

RouteBuilder builder = new RouteBuilder() {
    public void configure() {
        from("direct:a")
            .setProperty("myProperty", constant("test"))
            .to("direct:b");
    }
};

And the same example using XML:

<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="direct:a"/>
        <setProperty name="myProperty">
            <constant>test</constant>
        </setProperty>
        <to uri="direct:b"/>
    </route>
</camelContext>