Set Body EIP

The SetBody EIP allows you to set the body of your exchange.

Options

The Set Body EIP has no options.

Examples

The following example shows how to use the SetBody EIP

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

And the same example using XML:

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