Hi Lukas,
The Camel file component will "inject" a message per file.
It means that you can stop a route after just processing a message. You
can control that with another route containing a bean, and define when
you want to stop a route (after a number of processed files for instance).
In this blog:
http://blog.nanthrax.net/2011/08/use-camel-cxf-and-karaf-to-implement-batches/
I have a "login route" is stopped just after processing one message (so
one file in the case of the file component).
You can mimic this behavior to implement your needs.
Regards
JB
On 10/23/2011 08:50 PM, szaruba wrote:
Hi everybody,
After we got the expertise, that camel doesn't support consuming a fix
amount of files and stops after all files are consumed, we want to implement
our own customized endpoint, which is able to fulfill our requirements.
Basically we have to grab some files at a defined moment. We got a master
file, which contains the paths to all other files. So what we have to do is
to implement an endpoint, which
a) grabs the master file and opens it
b) consumes the other files, based on the paths in the master file
Sure we could simply use java.io. to open the file and extract data with
"Classic" java. But we have to use camel in our project and we want to
support ftp and other endpoint types too. So we want to create an endpoint
which takes an URI and is able to handle more than simple file access. (just
like the normal "from("URI)." in camel DSL)
We already got a hint which belongs to the "Consumer Template", which
describes how to implement our own "pojo based" endpoint:
http://camel.465427.n5.nabble.com/Non-polling-based-file-consumer-td4888325.html
Fact is that we want to use the camel build in function, which just takes an
URI and get the files from the specified URI. I know that's not a common
question, but where do I find this component or function? Is this function
or component always coupled with a polling consumer? Anyone have an idea how
to solve our problem without finding the corresponding camel function?
Currently I am reading the "Camel in Action" book to get more into camel and
find a solution in this case, but I would be very happy if anyone could give
me a hint or can show me an example of a customized endpoint.
If anybody need additional information please answer to this post.
Greetings and thanks in advance,
Lukas
--
View this message in context:
http://camel.465427.n5.nabble.com/How-to-grab-a-only-one-file-with-camel-tp4930104p4930104.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com