it would go through the whole file and it will cyclicly take each record (delimited by the token) and unmarshall it, etc.
But after having tested it, it seems that it only does it with the first record, ie until it finds the first occurrence of the token. Looking in the documentation at the "What the splitter returns", it says that it returns the last splitted message which, in my case, is the first record in the file. So this is what happened.
But I'm confused now as I need to cycle, occurrence of token by occurrence of token, until the end of the file.
It will iterate the expression, so in your case you are tokenizing the message body. Camel uses the java.util.Scanner when you use the tokenize in the DSL. So make sure that this tokenizer works as expected.
Thank you for helping again. Yes, the problem comes from the tokenizer. I made a separate test using the java.util.Scanner and it appears that it doesn't work as I expected. I have an XML file and I want to split it XML element by XML element.
And i use "</0>" as a tokenizer but, what happens is that the tokenizer itself, ie "</0>", is not included. Is there any option to specify a splitting such that to have every thing between <0> and </0>, including <0> and </0>, i any splited part ?
Many thanks. The current file is not too big and the splitting works for now, but it may become much larger. The problem is that the stax parsing and the XML tokens are supported, as far as I understood, starting with Camel 2.9 which is not yet available in download on the FuseSource web-site. It may be available at the Apache site but we are using the FuseSource one.