I figured out part of the problem.  The ".+" should indicate that we want 1
or more characters, but including it in the expression prevents the
exception for working at all.  Thank goodness for Test files.  I found an
example Test file that showed using the "include" and "exclude" parameters. 
I noticed that the expression the Test file used to include any file that
ended in txt was ".*txt".  Since I actually wanted any files that have an
extension of ".log" I changed my expression to ".*\.log" and it worked.

I'm still not sure why the ".+" didn't work.


bbuzzard wrote:
> 
> I have a drop folder that contains files with many different extensions. 
> I would like to route files with a particular extension into a queue.  It
> looks like the parameter "include" does exactly what I want, but I'm
> having trouble specifying any regex that will work.  
> 
> In my test example I created three files: test1.txt, test2.log and
> test3.txt.  My drop folder is "c:\aaa".  I specified the route in the
> webapps\camel\WEB-INF\applicationContext.xml file and it looks like this:
> <route id="Good Route">
>   <from uri="file://c:\\aaa?include=test2.log"/>
>   <to uri="activemq:testq"/>
> </route>
> When I copy the three files into the drop folder with the "Good Route" the
> test2.log file is moved to the queue.  But when I modify the "Good Route"
> to look like the following it does not work.
> <route id="Bad Route">
>   <from uri="file://c:\\aaa?include=.+.log"/>
>   <to uri="activemq:testq"/>
> </route?
> 
> I tested the expression ".+.log" in a simple JAVA program and it worked,
> so I'm guessing that I didn't correctly specify the include parameter in
> the route xml.  Would someone press tell me the correct way.
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Trying-to-consume-files-with-a-special-filename-extension-tp28287902p28287916.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Reply via email to