Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 90631 invoked from network); 7 Apr 2010 12:11:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Apr 2010 12:11:03 -0000 Received: (qmail 65655 invoked by uid 500); 7 Apr 2010 12:11:02 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 65576 invoked by uid 500); 7 Apr 2010 12:11:02 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 65568 invoked by uid 99); 7 Apr 2010 12:11:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 12:11:02 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.220.228 as permitted sender) Received: from [209.85.220.228] (HELO mail-fx0-f228.google.com) (209.85.220.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Apr 2010 12:10:58 +0000 Received: by fxm28 with SMTP id 28so1302175fxm.36 for ; Wed, 07 Apr 2010 05:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type :content-transfer-encoding; bh=hGG6FEe66S1tSM5WFlZltXMJJIaA7cACKrPT2IC2gK8=; b=FN4NS8jOTTjz2IT98KqP3kNRIJRoOJT/h3+I3VVD6ulNREXm8n+X866fiRGjp4FSFo 32N+RMUH0YyeIuJnmJ5YKvQOMmVpqj5cCWO2kqN7BNhed5thD7EbvJIbsXBfo67hrghK 5hSLTmo+7W7O/QPze5ECawt0GL3No5kPwymJs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=G4ebxcxCOF+jDvTce43xFKCJqhJfGtqozD/0qhG9I1M1byjK3QEbUCoL7CmpQE8Xrp ImoxrvgczTUx3m8rk1zwjl4Sn0GY18GtfC3JGLZoTH1fWzl2nlMbu298KGyzkU+ud5T3 GGUcPIbZp9mr/3AW/Ccft/ENED+KkErdGi4Ws= MIME-Version: 1.0 Received: by 10.223.109.11 with HTTP; Wed, 7 Apr 2010 05:10:17 -0700 (PDT) In-Reply-To: References: <28154602.post@talk.nabble.com> <28155375.post@talk.nabble.com> <28162033.post@talk.nabble.com> <28162146.post@talk.nabble.com> <28162632.post@talk.nabble.com> From: Claus Ibsen Date: Wed, 7 Apr 2010 14:10:17 +0200 Received: by 10.223.50.68 with SMTP id y4mr825852faf.51.1270642237176; Wed, 07 Apr 2010 05:10:37 -0700 (PDT) Message-ID: Subject: Re: FileComponent Camel 2.2 To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi I recon there is something in all you code that messes up the Camel headers= . You could just try a very simple route to see if it can pickup the files and just move them to .camel Here is output from my test /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java -Dfile.encoding=3DMacRoman -classpath /Applications/IntelliJ IDEA 9.0 CE.app/plugins/junit/lib/junit-rt.jar:/System/Library/Frameworks/JavaVM.fra= mework/Versions/1.5.0/Home/lib/deploy.jar:/System/Library/Frameworks/JavaVM= .framework/Versions/1.5.0/Classes/dt.jar:/System/Library/Frameworks/JavaVM.= framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.= framework/Versions/1.5.0/Home/lib/plugin.jar:/System/Library/Frameworks/Jav= aVM.framework/Versions/1.5.0/Home/lib/sa-jdi.jar:/System/Library/Frameworks= /JavaVM.framework/Versions/1.5.0/Classes/charsets.jar:/System/Library/Frame= works/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/F= rameworks/JavaVM.framework/Versions/1.5.0/Classes/jconsole.jar:/System/Libr= ary/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Lib= rary/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Lib= rary/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Libr= ary/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/apple_provider.= jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext= /dnsns.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/= lib/ext/localedata.jar:/System/Library/Frameworks/JavaVM.framework/Versions= /1.5.0/Home/lib/ext/sunjce_provider.jar:/System/Library/Frameworks/JavaVM.f= ramework/Versions/1.5.0/Home/lib/ext/sunpkcs11.jar:/workspace/camel/camel-c= ore/target/test-classes:/workspace/camel/camel-core/target/classes:/Users/d= avsclaus/.m2/repository/commons-logging/commons-logging-api/1.1/commons-log= ging-api-1.1.jar:/Users/davsclaus/.m2/repository/org/fusesource/commonman/c= ommons-management/1.0/commons-management-1.0.jar:/Users/davsclaus/.m2/repos= itory/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar:/Us= ers/davsclaus/.m2/repository/commons-logging/commons-logging/1.1.1/commons-= logging-1.1.1.jar:/Users/davsclaus/.m2/repository/junit/junit/3.8.2/junit-3= .8.2.jar:/Users/davsclaus/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.ja= r:/Users/davsclaus/.m2/repository/org/springframework/spring-aop/2.5.6/spri= ng-aop-2.5.6.jar:/Users/davsclaus/.m2/repository/aopalliance/aopalliance/1.= 0/aopalliance-1.0.jar:/Users/davsclaus/.m2/repository/org/springframework/s= pring-beans/2.5.6/spring-beans-2.5.6.jar:/Users/davsclaus/.m2/repository/or= g/springframework/spring-core/2.5.6/spring-core-2.5.6.jar:/Users/davsclaus/= .m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar:/Users/davsclau= s/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar:/Users/= davsclaus/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar= :/Users/davsclaus/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.12/jaxb-imp= l-2.1.12.jar:/Applications/IntelliJ IDEA 9.0 CE.app/lib/idea_rt.jar com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 org.apache.camel.component.file.FileAbsoluteMoveDefaultIssueTest 2010-04-07 14:08:20,460 [main ] INFO DefaultCamelContext - Apache Camel (CamelContext: camel-1) is starting 2010-04-07 14:08:20,461 [main ] INFO DefaultCamelContext - JMX is disabled. Using DefaultManagementStrategy. 2010-04-07 14:08:20,902 [main ] INFO DefaultCamelContext - Route: route1 started and consuming from: Endpoint[file:///opt/feeds/ebook/in?include=3D.*%5C.txt&sortBy=3Dfile%3Anam= e] 2010-04-07 14:08:20,903 [main ] INFO DefaultCamelContext - Started 1 routes 2010-04-07 14:08:20,904 [main ] INFO DefaultCamelContext - Apache Camel (CamelContext: camel-1) started 2010-04-07 14:08:20,936 [main ] INFO MockEndpoint - Asserting: Endpoint[mock://result] is satisfied 2010-04-07 14:08:21,917 [tBy=3Dfile%3Aname] INFO foo - Exchange[Id:152d5d0c-f13d-443c-a39b-022c67baa5bb, ExchangePattern:InOnly, Properties:{CamelBatchComplete=3Dtrue, CamelToEndpoint=3Dlog://foo?showAll=3Dtrue, CamelBatchSize=3D1, CamelFileLock=3D/opt/feeds/ebook/in/hello.txt.camelLock, CamelBatchIndex=3D0, CamelFileExchangeFile=3DGenericFile[/opt/feeds/ebook/in/hello.txt], CamelFileLockName=3D/opt/feeds/ebook/in/hello.txt.camelLock}, Headers:{FILE_ID=3Dhello, CamelFileLastModified=3DWed Apr 07 14:08:20 CEST 2010, CamelFileRelativePath=3D/opt/feeds/ebook/in/hello.txt, CamelFileAbsolute=3Dtrue, CamelFileNameOnly=3Dhello.txt, CamelFilePath=3D/opt/feeds/ebook/in/hello.txt, CamelFileName=3Dhello.txt, CamelFileParent=3D/opt/feeds/ebook/in, CamelFileLength=3D11, CamelFileAbsolutePath=3D/opt/feeds/ebook/in/hello.txt}, BodyType:String, Body:Hello World, Out: null] 2010-04-07 14:08:21,924 [tBy=3Dfile%3Aname] TRACE GenericFile - Changing name to: /opt/feeds/ebook/in/.camel/hello.txt 2010-04-07 14:08:21,924 [main ] INFO DefaultCamelContext - Apache Camel (CamelContext:camel-1) is shutting down 2010-04-07 14:08:21,929 [tBy=3Dfile%3Aname] TRACE GenericFile - Normalized endpointPath: /opt/feeds/ebook/in 2010-04-07 14:08:21,930 [tBy=3Dfile%3Aname] TRACE GenericFile - Normalized newFileName: /opt/feeds/ebook/in/.camel/hello.txt 2010-04-07 14:08:21,929 [main ] INFO DefaultShutdownStrategy - Starting to graceful shutdown 1 routes (timeout 10 seconds) 2010-04-07 14:08:21,930 [tBy=3Dfile%3Aname] TRACE GenericFile - FileNameOnly: hello.txt 2010-04-07 14:08:21,931 [tBy=3Dfile%3Aname] TRACE GenericFile - FileName: hello.txt 2010-04-07 14:08:21,932 [tBy=3Dfile%3Aname] TRACE GenericFile - Absolute: true 2010-04-07 14:08:21,932 [tBy=3Dfile%3Aname] TRACE GenericFile - Relative path: /opt/feeds/ebook/in/.camel/hello.txt 2010-04-07 14:08:21,932 [tBy=3Dfile%3Aname] TRACE GenericFile - Absolute path: /opt/feeds/ebook/in/.camel/hello.txt 2010-04-07 14:08:21,933 [tBy=3Dfile%3Aname] TRACE GenericFile - Name changed to: GenericFile[/opt/feeds/ebook/in/.camel/hello.txt] 2010-04-07 14:08:21,933 [ - ShutdownTask] INFO DefaultShutdownStrategy - Route: route1 suspended and shutdown deferred, was consuming from: Endpoint[file:///opt/feeds/ebook/in?include=3D.*%5C.txt&sortBy=3Dfile%3Anam= e] 2010-04-07 14:08:21,935 [ - ShutdownTask] INFO DefaultShutdownStrategy - Route: route1 shutdown complete. 2010-04-07 14:08:21,935 [main ] INFO DefaultShutdownStrategy - Graceful shutdown of 1 routes completed in 0 seconds 2010-04-07 14:08:21,936 [main ] INFO DefaultInflightRepository - Shutting down with no inflight exchanges. 2010-04-07 14:08:21,937 [main ] INFO DefaultCamelContext - Apache Camel (CamelContext: camel-1) is shutdown Process finished with exit code 0 In a simple uni tests public class FileAbsoluteMoveDefaultIssueTest extends ContextTestSupport { @Override protected void setUp() throws Exception { deleteDirectory("opt/feeds/"); super.setUp(); } public void testAbsolute() throws Exception { MockEndpoint mock =3D getMockEndpoint("mock:result"); mock.expectedBodiesReceived("Hello World"); mock.expectedFileExists("/opt/feeds/ebook/in/.camel/hello.txt"); template.sendBodyAndHeader("file:/opt/feeds/ebook/in", "Hello World", Exchange.FILE_NAME, "hello.txt"); assertMockEndpointsSatisfied(); } @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("file:/opt/feeds/ebook/in?sortBy=3Dfile:name&include=3D.*\\.txt") .convertBodyTo(String.class) .setHeader("FILE_ID", SimpleLanguage.simple("${file:onlyname.noext}")) .to("log:foo?showAll=3Dtrue") .to("mock:result"); } }; } } On Wed, Apr 7, 2010 at 2:06 PM, Claus Ibsen wrote: > Hi > > Try using the Tracer and/or add this logging to the end of your route > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("log:foo?showAll=3Dtru= e") > > It could be something in all your processors and whatnot which messes > with the headers. > > I have created an unit test on my system and it works all the time. > > > > On Wed, Apr 7, 2010 at 11:35 AM, Nick Mitchell = wrote: >> >> from(cronTriggerExpression) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .pollEnrich(ebookRemoteFTPIn= ,0) >> =A0 =A0 =A0 =A0.idempotentConsumer(header("CamelFileName"),filenameRepos= itory) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to(ebookIn); >> >> =A0 =A0 =A0 =A0 =A0 from(ebookIn) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.process( new SetupChildR= outeRuntime(metaRouteId,childRouteId+0, >> baseDao) ) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.unmarshal(new XMLebookDa= taFormat()) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.process(new CSVebookProc= essor(ebookOut, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ebookTable, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0authorTable, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0drminfoTable, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ebookSubjectTable, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0abstractBook2BiccodeTable, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A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=A0 =A0 =A0 =A0 =A0catalogDao, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0productDao, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0composedTypeDao, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0etlStats, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0true, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0currentVatRate >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0) ) >> =A0 =A0 =A0 =A0.setHeader("FILE_ID", >> SimpleLanguage.simple("${file:onlyname.noext}")) >> =A0 =A0 =A0 =A0.process(new ZipProcessorHybris(ebookOut, ebookZipOut, >> ebookOutFileName, true, ebookZipIn, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A00L, "[_.]","_{0}_{date}",= etlStats)) >> =A0 =A0 =A0 =A0.process(new EmailProcessor(mailService,etlStats,ebookZip= In)) >> =A0 =A0 =A0 =A0.process( new EtlProcessSuccess(baseDao)) >> =A0 =A0 =A0 =A0 =A0 =A0.process(new CleanExchange()) >> =A0 =A0 =A0 =A0 =A0 =A0.delay().method( "com.lbi.etl.utils.beans.Delayer= ", "forceGC" ); >> >> I've tried to fill in some constants so it makes a bit more sense to you= . >> The processors in the route don't really do much. Basically the route po= lls >> for an XML file, processes the XML file, converts to a csv format, puts = the >> output file in a different directory and emails to say successful. >> >> Cheers >> Nick >> >> >> Claus Ibsen-2 wrote: >>> >>> Hi >>> >>> Could you post your route? I will then use it to reproduce the issue >>> on my laptop. >>> >>> >>> On Wed, Apr 7, 2010 at 10:45 AM, Nick Mitchell >>> wrote: >>>> >>>> We are setting FILE_ID in the header >>>> >>>> .setHeader(FILE_ID, SimpleLanguage.simple("${file:onlyname.noext}")) >>>> >>>> If I change the file expression to ${file:name.ext} then it does move = it >>>> to >>>> .camel folder. I confused as to why it worked before and not now thoug= h. >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/FileComponent-Camel-2.2-tp28154602p28162146.html >>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>> >>>> >>> >>> >>> >>> -- >>> Claus Ibsen >>> Apache Camel Committer >>> >>> Author of Camel in Action: http://www.manning.com/ibsen/ >>> Open Source Integration: http://fusesource.com >>> Blog: http://davsclaus.blogspot.com/ >>> Twitter: http://twitter.com/davsclaus >>> >>> >> >> -- >> View this message in context: http://old.nabble.com/FileComponent-Camel-= 2.2-tp28154602p28162632.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > --=20 Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus