Why can I not use when or otherwise in a Java Camel routePage edited by Richard KettelerijChanges (1)
Full ContentWhy can I not use when/otherwise in a Java Camel route?When using the Content Based Router in the Java DSL you may have a situation where the compiler will not accept the following when() or otherwise() statement.
For example as shown in the route below where we use the Load Balancer inside the Content Based Router in the first when: Code will not compile from("direct:start") .choice() .when(body().contains("Camel")) .loadBalance().roundRobin().to("mock:foo").to("mock:bar") .otherwise() .to("mock:result");
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|