I'm struggling with a very odd issue with Camel 2.10 and I'm hoping someone could explain why it's occurring. I've attached a test case that demonstrates the issue. It is a very simple route - just take a file from a local directory and FTP it to a server. Here is the problem:
When I specify the character set in the file producer, Camel cannot rename the file from the source directory to the .processed directory (.move directory). It is unable to acquire an exclusive file lock. However, when I remove the charset=UTF-8 parameter, everything works properly. The file is FTPed and is moved to the .processed directory. Why does the character encoding cause an issue with read locks? Am I doing something incorrect or is this a bug? I'm using Camel 2.10 and Java 1.6.0_33 under Windows 7. ------------ - Test case ------------ package com.comp.test.camel.route.impl; import junit.framework.Assert; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.test.junit4.CamelTestSupport; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Test; public class FileMoveTest extends CamelTestSupport { protected Log log = LogFactory.getLog(FileMoveTest.class); @Test public void testRoute() throws Exception { try { Thread.sleep(140000); } catch (Exception e) { log.error(e.getMessage(), e); Assert.fail(e.getMessage()); } } /* * (non-Javadoc) * * @see org.apache.camel.test.junit4.CamelTestSupport#createRouteBuilder() */ @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { // Works // from("file://c:/fileMoveTest/in?move=.processed&moveFailed=.failed&delay=5000&readLock=rename&include=.*\\.csv$").to( // "ftp://anonymous@ftpTest/test?password=anonymous&delay=5000&throwExceptionOnConnectFailed=true"); // Fails from("file://c:/fileMoveTest/in?charset=UTF-8&move=.processed&moveFailed=.failed&delay=5000&readLock=rename&include=.*\\.csv$").to( "ftp://anonymous@ftpTest/test?password=anonymous&delay=5000&throwExceptionOnConnectFailed=true"); } }; } } -- View this message in context: http://camel.465427.n5.nabble.com/Character-set-issue-with-File-Consumer-FTP-Publication-tp5717025.html Sent from the Camel - Users mailing list archive at Nabble.com.