1

I haven't found any useful explanation about when to use end() and endChoice() ? Also endChoice() is meant for what type of camel nodes (I am aware of only loadBalance) ?

Raju Parashar
  • 312
  • 4
  • 17
  • Possible duplicate of [Camel end vs endChoice - not the usual query](https://stackoverflow.com/questions/32382322/camel-end-vs-endchoice-not-the-usual-query) – Roman Vottner Mar 10 '19 at 12:39
  • Loosely speaking, `.endChoice()` ends a certain choice (`.when(...)`) within the list of defined choices while the `.end()` definition will end the whole choice. – Roman Vottner Mar 10 '19 at 12:44
  • So, do you mean we can end when() with endChoice() ? – Raju Parashar Mar 10 '19 at 13:05
  • 2
    The `.endChoice()` definition allows you to get back to the `.choice` definition and therefore allow further `.when(...)` clauses or the `.otherwise(...)` clause to be specified. You can also [read up the official explanation on why this step is necessary](https://github.com/apache/camel/blob/master/docs/user-manual/en/faq/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.adoc) – Roman Vottner Mar 10 '19 at 13:09
  • @RomanVottner - I already knew about this link and went through it, but it is still not clear. – Raju Parashar Mar 10 '19 at 13:14

0 Answers0