Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between end() and endChoice() in Apache Camel

Tags:

apache-camel

Can anyone tell me the difference between end() and endChoice() in camel? Can we use end() in place of endChoice()?

like image 606
Santhosh Tangudu Avatar asked Apr 15 '15 10:04

Santhosh Tangudu


People also ask

How do you end camel choice?

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() .

What is predicate in camel?

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.

What is Java DSL in camel?

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.

What is Apache Camel integration framework?

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).


1 Answers

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:

  • endChoice
  • end
like image 179
Kajzer Avatar answered Sep 23 '22 11:09

Kajzer