Hi All,
I am using camel 2.9.2.
I have case like this: route message from file and do transformation, then
do dynamic routing. If some error happened due to invalid destination, I
want to move the original message to error folder.
public void configure() throws Exception {
onException(Exception.class).handled(true).maximumRedeliveries(0).useOriginalMessage()
.to("file://D:/error");
from("file://D:/inbox").process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
//change the message body to "B"
exchange.getIn().setBody("B");
}
}).process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
//Try to put some invalid destination
exchange.getIn().setHeader("path", "file://Z:/inbox");
}
}).recipientList(header("path"));
}
I have file (in D:/inbox) contents "A" inside. After throwing the exception,
I check in the error folder, the file contents "B". My expect result is "A".
Is it the correct behavior?
Thanks
Agustino
--
View this message in context:
http://camel.465427.n5.nabble.com/useOriginalMessage-in-recipientList-return-the-wrong-message-tp5675017p5675017.html
Sent from the Camel - Users mailing list archive at Nabble.com.