Question 1
IntermediateCamel Integration Patterns · Routing Patterns
You are developing a cloud-native integration application using Red Hat Fuse on OpenShift. You need to implement a Content-Based Router pattern to direct incoming orders to different processing endpoints based on the 'orderType' header. Which Camel Java DSL syntax correctly implements this pattern?
Answer and explanation
Correct answer: B
The .choice() method initiates the Content-Based Router pattern in Camel Java DSL. It is followed by one or more .when() clauses that evaluate predicates (like checking a header value), and optionally an .otherwise() clause for default routing. This structure accurately routes messages based on content.
