Search code examples
javaapache-camel

Throwing exception in apache camel


In apache camel is there a difference if I just :

throw new RuntimeException();

or :

exchnage.setException(new RuntimeException())

?


Solution

  • You can use both of them , setException method works for this two case, they give the same result