in routes-configuration/src/main/java/sample/camel/MyJavaRouteBuilder.java [28:36]
public void configure() throws Exception {
from("timer:java?period=2s")
// refer to the route configuration by the id to use for this route
.routeConfigurationId("javaError")
.setBody(method(MyJavaRouteBuilder.class, "randomNumber"))
.log("Random number ${body}")
.filter(simple("${body} < 30"))
.throwException(new IllegalArgumentException("The number is too low"));
}