Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When the the message is out of date, a ValidationException is thrown. To make it a little elegant, you may use doTry...doCatch...doFinally to wrap it up and specify a queue to store the invalid messages.

Code Block

from("file:src/data?noop=true").convertBodyTo(java.lang.String.class)
.doTry().processRef("validatingProcessor").to("stream:out").to("activemq:personnel.records")
.doCatch(ValidationException.class).to("mock:invalid").end()

Simpify your test by using Web Console

...