[
https://issues.apache.org/jira/browse/CAMEL-18042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531231#comment-17531231
]
Yasser Zamani commented on CAMEL-18042:
---------------------------------------
[~davsclaus] Firstly I'm not talking about doFinally, but about doCatch. It's
not the case anyway. Furthermore everyone rationally expects stopping the rest
of the route when exception occurs, you're right, but I'm talking about the
first route.
Sorry I think you haven't read description carefully please. Again, when I use
{{throwException(new RuntimeException("Failed to upload"))}} instead of
{{rollback()}} in the second route, I see both logs in the first route (i.e. it
doesn't stop in your words). But with {{rollback()}} I see only the first log.
Trust me. I struggled a lot with it. In summary we can't catch the exception
thrown by {{rolback()}} in Camel, because I don't know what Camel does
internally but anyway it causes to execute only one step after doCatch and
prunes the rest of the route.
> doCatch of a rollback only executes one line after doCatch and prune the rest
> of the route
> ------------------------------------------------------------------------------------------
>
> Key: CAMEL-18042
> URL: https://issues.apache.org/jira/browse/CAMEL-18042
> Project: Camel
> Issue Type: Bug
> Components: came-core
> Affects Versions: 3.16.0
> Reporter: Yasser Zamani
> Priority: Minor
>
> I have following route (simplified)
> {code:java}
>
> from("quartz://MY_CTRL?cron=0+0/10+8-12+?+*+MON-FRI").routeId("MY_CTRL").
> transacted("PROPAGATION_NEVER").
> .
> .
> .
> doTry().
> to("direct:MY_CSV").
> doCatch(Throwable.class).
> log("CSV generation or upload failed. So delete azure blob").
> log("blahblahblah").
> end(); // end try
> from("direct:MY_CSV").routeId("MY_CSV").
> transacted().
> .
> .
> .
> filter(body().isNotEqualTo(Boolean.TRUE)).
> rollback()
> stop().
> end().
> .
> .
> .
> {code}
> that doesn't print {{blahblahblah}}. When I replace {{rolback()}} with
> {{throwException(new RuntimeException("Failed to upload"))}} it does.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)