Thanks everyone for your assistance!
The errorHandler for JMS component was not able to handle the
ConnectException but exceptionListener option was able to do so. Following
is the code snippet for the same....
<bean id="springErrorHandler" class="faultHandler.SpringErrorHandler"/>
<bean id="jmsExceptionListener" class="faultHandler.JmsExceptionListener"/>
<bean id="edmPollingStartegy" class="strategies.EdmPollingStartegy"/>
*<camel:camelContext id="sampleContext">
<camel:onException>
<camel:exception>javax.jms.JMSException</camel:exception>
<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?errorHandler=#springErrorHandler"/>
<camel:to
uri="file:home/ebijcha/Documents/Camel_Work_Dir/FTP_Inbox?noop=true;consumer.bridgeErrorHandler=true"/>
<camel:to
uri="ftp://admin@localhost:2121?password=xxxx;fileName=.logout;throwExceptionOnConnectFailed=true;pollStrategy=#edmPollingStartegy"/>*
Also the consumer.bridgeErrorHandler=true option and pollStrategy was not
able to handle the exceptions at connect/login failures for FTP component.
public class EdmPollingStartegy implements PollingConsumerPollingStrategy{
@Override
public void afterPoll() throws Exception {
System.out.println("After Poll!");
}
@Override
public long beforePoll(long arg0) throws Exception {
System.out.println("Before Poll!");
return 0;
}
@Override
public void onInit() throws Exception {
System.out.println("Init Poll!");
}
}
None of the methods in pollingStrategy were called. Any idea what could be
the problem?
Regards,
Bijoy
--
View this message in context:
http://camel.465427.n5.nabble.com/Handling-ConnectException-at-route-startup-tp5745762p5745832.html
Sent from the Camel - Users mailing list archive at Nabble.com.