[
https://issues.apache.org/jira/browse/CAMEL-13174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16763515#comment-16763515
]
Gerold Broser edited comment on CAMEL-13174 at 2/8/19 11:50 AM:
----------------------------------------------------------------
@[~ancosen] I set this issue's _Priority: Critical_ since [its inline
help|https://issues.apache.org/jira/secure/ShowConstantsHelp.jspa?decorator=popup#PriorityLevels]
says:
{quote}*↑* Critical Crashes, ...{quote}
I considered:
{quote}2019-02-08 12:03:10.103 INFO camel.impl.DefaultCamelContext – Apache
Camel 2.23.1 (CamelContext: camel-1) is shutting down
2019-02-08 12:03:10.103 INFO camel.main.MainLifecycleStrategy – CamelContext:
camel-1 has been shutdown, triggering shutdown of the JVM.
{quote}
after the said exception, thus abandoning all other routes in all other
contexts as well, being a "crash".
was (Author: broser):
@[~ancosen] I set this issue's _Priority: Critical_ since [its inline
help|https://issues.apache.org/jira/secure/ShowConstantsHelp.jspa?decorator=popup#PriorityLevels]
says:
{quote}!/jira/images/icons/priorities/critical.svg|width=16! Critical
Crashes, ...
{quote}
I considered:
{quote}2019-02-08 12:03:10.103 INFO camel.impl.DefaultCamelContext – Apache
Camel 2.23.1 (CamelContext: camel-1) is shutting down
2019-02-08 12:03:10.103 INFO camel.main.MainLifecycleStrategy – CamelContext:
camel-1 has been shutdown, triggering shutdown of the JVM.
{quote}
after the said exception, thus abandoning all other routes in all other
contexts as well, being a "crash".
> [consumer.]bridgeErrorHandler doesn't handle exception thrown by
> startingDirectoryMustExist
> -------------------------------------------------------------------------------------------
>
> Key: CAMEL-13174
> URL: https://issues.apache.org/jira/browse/CAMEL-13174
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.23.1
> Reporter: Gerold Broser
> Priority: Major
> Labels: camel-file, consumer, exception-handling
>
> Following [StackOverflow: _File component's \[consumer.\]bridgeErrorHandler
> in conjunction with startingDirectoryMustExist_
> |https://stackoverflow.com/questions/54513101/file-components-consumer-bridgeerrorhandler-in-conjunction-with-startingdirec]
> I created the following test class:
> {code:java}
> package test;
> import org.apache.camel.LoggingLevel;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.main.Main;
> import org.junit.After;
> import org.junit.Before;
> import org.junit.Test;
> public class CamelBridgeErrorHandlerTest {
> private Main main;
> @Before
> public void before() {
> main = new Main();
> }
> @Test
> public void bridgeErrorHandler() {
> main.addRouteBuilder(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> route(this,
> "file:not.existing.dir?autoCreate=false&startingDirectoryMustExist=true&bridgeErrorHandler=true");
> }
> });
> }
> @Test
> public void consumerBridgeErrorHandler() {
> main.addRouteBuilder(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> route(this,
> "file:not.existing.dir?autoCreate=false&startingDirectoryMustExist=true&consumer.bridgeErrorHandler=true");
> }
> });
> }
> private void route(final RouteBuilder builder, final String consumerURI) {
> builder
> .from(consumerURI)
> // this is never reached
> .onException(Exception.class)
> .handled(true)
> .log(LoggingLevel.ERROR, "${exception}")
> .end()
> .log(" ... processing ...");
> }
> @After
> public void after() throws Exception {
> main.start();
> }
> }
> {code}
> Both test methods throw:
> {noformat}
> org.apache.camel.FailedToCreateRouteException: Failed to create route routeN:
> Route(routeN)[[From[file:not.existing.dir?autoCreate=false&s...
> because of Starting directory does not exist: not.existing.dir
> {noformat}
> rather than the exception(s) being handled by the route(s)' {{onException()}}.
> ----
> P.S.: When TRACEing through the log output both test methods show:
> {quote}2019-02-08 11:29:36.209 TRACE camel.model.ProcessorDefinitionHelper –
> There are 6 properties on:
> From\[file:not.existing.dir?autoCreate=false&startingDirectoryMustExist=true&\{consumer.}bridgeErrorHandler=true\]
> {quote}
> while there are just 3 of them ({{autoCreate}},
> {{startingDirectoryMustExist}}, {{[consumer.]bridgeErrorHandler}}), aren't
> there? Is this worth another issue?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)