Hi Baudoust,
I want to configure the routes dynamically with Spring DSL. Whatever you
mentioned is achieved putting <onException> under context scope as below...
<camel:camelContext id="sampleContext">
*<camel:onException>
<camel:exception>java.lang.Exception</camel:exception>
<camel:handled><camel:constant>true</camel:constant></camel:handled>
<camel:setHeader
headerName="raiseAlarm"><camel:constant>true</camel:constant></camel:setHeader>
<camel:process ref="edmErrorProcessor"/>
</camel:onException> *
<camel:route id="fileTransport" handleFault="true">
<camel:from uri="activemq:queue:test"/>
<camel:process ref="edmMessageProcessor"/>
<camel:to
uri="ftp://localhost:2121?username=admin;password=admin;fileName=pom.xml;throwExceptionOnConnectFailed=true"/>
<camel:log message="Processing ${header.CamelFileName}
file!!!"></camel:log>
<camel:to
uri="file:///home/ebijcha/Documents/Camel_Work_Dir/FTP_Inbox"/>
</camel:camelContext>
So I'm able to handle the exceptions when route is established without any
startup error and when exchange object is created. But if ConnectException
occurs at very first while connecting to JMS server, the exchange object
does not get created and the exception is not propagated to camel. Thus the
exception is not being handled by global handler. Same is the case for FTP
component.
Is there anyway to handle those exceptions globally?
Regards,
Bijoy
--
View this message in context:
http://camel.465427.n5.nabble.com/Handling-ConnectException-at-route-startup-tp5745762p5745782.html
Sent from the Camel - Users mailing list archive at Nabble.com.