// to handle any IOException being thrown
onException(IOException.class)
.handled(true)
.log("IOException occurred due: ${exception.message}")
.transform().simple("Error ${exception.message}")
.to("mock:error");
// this is the file route that pickup files, notice how we bridge the consumer to use the Camel routing error handler
// the exclusiveReadLockStrategy is only configured because this is from an unit test, so we use that to simulate exceptions
from("file:target/nospace?consumer.bridgeErrorHandler=true")
.convertBodyTo(String.class)
.to("mock:result");
// to handle any IOException being thrown
onException(IOException.class)
.handled(true)
.log("IOException occurred due: ${exception.message}")
.transform().simple("Error ${exception.message}")
.to("mock:error");
// this is the file route that pickup files, notice how we bridge the consumer to use the Camel routing error handler
// the exclusiveReadLockStrategy is only configured because this is from an unit test, so we use that to simulate exceptions
from("file:target/nospace?consumer.bridgeErrorHandler=true")
.convertBodyTo(String.class)
.to("mock:result");
Copy to ClipboardCopied!Toggle word wrapToggle overflow