...
Code Block | ||||
---|---|---|---|---|
| ||||
public void process(Exchange exchange) throws Exception {
String body = exchange.getIn().getBody(String.class);
// change the message to say Hello
exchange.getOut().setBody("Hello " + body);
// copy headers from IN to OUT to propagate them
exchange.getOut().setHeaders(exchange.getIn().getHeaders());
}
|
Well that is not all, a Message can also contain attachments so to be sure you need to propagate those as well:
...