Hi Yes as harinair pointed out you have to configure the error handling to your use case. I agree the default one in Camel 1.x is really not good. We have changed that in Camel 2.0 so it doesnt use the DeadLetterChannel so the exception is propagated back to the caller. Well that is just a side note.
For error handling in general with Camel take a look here. And follow the links in the wiki documenation http://camel.apache.org/error-handling-in-camel.html On Fri, May 22, 2009 at 1:48 AM, harinair <[email protected]> wrote: > > I guess I answer the question in your other thread - in case you did not see > (I write it as a Spring Context file - probably you get the idea): > > > <!-- Configures the Camel Context--> > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:util="http://www.springframework.org/schema/util" > xmlns:context="http://www.springframework.org/schema/context" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd > http://www.springframework.org/schema/util > http://www.springframework.org/schema/util/spring-util-2.5.xsd > http://activemq.apache.org/camel/schema/spring > http://activemq.apache.org/camel/schema/spring/camel-spring.xsd > http://www.springframework.org/schema/context > http://www.springframework.org/schema/context/spring-context-2.1.xsd" > xmlns:ns2="null" xmlns:ns3="null" xmlns:ns4="null" xmlns:ns5="null" > xmlns:ns6="null"> > <context:component-scan base-package="com.globalstar.router" /> > > <bean id="errorHandler" > class="org.apache.camel.builder.DeadLetterChannelBuilder"> > <property name="defaultDeadLetterEndpointUri" > value="file://whereEverYouWant" /> > <property name="redeliveryPolicy" ref="redeliveryPolicy" /> > </bean> > > <bean id="redeliveryPolicy" > class="org.apache.camel.processor.RedeliveryPolicy"> > <property name="initialRedeliveryDelay" value="300" /> > <property name="maximumRedeliveryDelay" value="8000" /> > <property name="backOffMultiplier" value="2" /> > <property name="maximumRedeliveries" value="5" /> > <property name="useExponentialBackOff" value="true" /> > </bean> > > <route errorHandlerRef="errorHandler"> > <from uri="file://files-to-upload?consumer.delay=60000"/> > <to uri="ftp://ca...@localhost?password=camel"/> > </route> > </beans> > > > Peter Thygesen-3 wrote: >> >> I writing a simple route that uploads files put in a folder. >> >> Configuration: running camel on ApacheMQ 5.2.0 >> >> (camel part of activemq.xml) nothing fancy.. >> <camelContext id="cision-file-channel" >> xmlns="http://activemq.apache.org/camel/schema/spring"> >> <route> >> <from uri="file://files-to-upload?consumer.delay=60000"/> >> <to uri="ftp://ca...@localhost?password=camel"/> >> </route> >> </camelContext> >> >> This works "fine" when the FTP Server is running. When FTP ser is down, it >> retries, then dump the filen on deadletterchannel e.a. the log file. Not >> very useful. >> >> >> 1) How do I make sure it is not dumped in the log file.. pretty much any >> other place would be better. E.g. another folder. Most of all I would like >> it to stay in the upload folder until connection has been reestablished. >> >> 2) There is .camel folder in the upload folder. This folder contains the >> files that have been processed. Who and when is this folder cleanup and >> how large will it grow? >> >> Hope you can help out a newbie like me >> >> BTW >> I fould a posting where you discuss threadsafety and ftp producer >> http://www.nabble.com/Threadsafety-of-Camel-FTP-td23615932.html >> Here you talk about the possibility of making a new uri option for >> concurrent producer. Was this very interesting idea entered in jira? >> >> Thx Peter >> >> > > -- > View this message in context: > http://www.nabble.com/Simple-FTP-producer-with-errorhandling-tp23655162p23662262.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
