Which version of Camel are you using?
And what did you do that you think are not working? Eg post your route configuration.
And do you want to consume the file during a route or from the start?
I'm using Fuse ESB 4.
I am doing everything in an OSGI bundle.
The route-ref is setup in my bundle-context.xml
I then use a java class that extends RouteBuilder to execute the route
basically, I want to:
detect a trigger file with a specific name (Starting point of my route)
consume 2 separate files with specific names
transform both files from fixed-width to XML
send transformed output to 2 seperate active MQ queues.
Here's my bundle-context.xml
Look at the Camel 1.x file documentation at:
Use the consumer.regexPattern to set a regular expression with the filename pattern you want to match.
For example: ^me.*xml$ to match files starting with me and ending with xml.
One more question though:
my process is triggered by a file arriving in a folder. Once this file is consumed, I need to consume 2 specific files from the same folder and process them.
How would you approach a situation like this?
I understand that every from(...) starts a new route?
You dont have to shoehorn everything into Camel.
You could just read the files manually using a processor / pojo.
You can also use the Camel type converter to easily read the file
File file = new java.io.File("my file name goes here"); String context = exchange.getContext().getTypeConverter().convertTo(String.class, file);
You can also consume the files from a processor as shown in the FTP wiki page here:
In the section - Consuming a remote FTP server triggered by a route