Can anyone tell me the difference between end()
and endChoice()
in camel? Can we use end()
in place of endChoice()
?
So we need to help Java a bit, which you do by using . endChoice() , which tells Camel to "pop the stack" and return to the scope of the Choice EIP. from("direct:start") . choice() .
A Predicate is being evaluated to a boolean value so the result is either true or false . This makes predicates so powerful as it is often used to control the routing of message in which path they should be routed.
Camel uses a Java Domain Specific Language or DSL for creating Enterprise Integration Patterns or Routes in a variety of domain-specific languages (DSL) as listed below: Java DSL - A Java based DSL using the fluent builder style.
Apache Camel ™ is a versatile open-source integration framework based on known Enterprise Integration Patterns. Camel empowers you to define routing and mediation rules in a variety of domain-specific languages (DSL, such as Java, XML, Groovy, Kotlin, and YAML).
The endChoice()
has quite an unfortunate naming. It doesn't end the choice()
block, it just ends the current when()
clause.
end()
on the other hand closes the current choice()
block.
Can also be seen in the javadocs:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With