5 Replies Latest reply on Apr 27, 2012 11:46 AM by davsclaus

    The splitter - how does it work ?

    simplex-software

      Greetings,

       

      Looking at the splitter, I was thinking that it is recursive. I mean, given a route like the following:

       

      from("...").split(body().tokenize("...")).streaming().unmarshal(new JaxbDataFormat(...))

       

      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.

       

      How could I don this ?

       

      Many thanks in advance,

       

      Nicolas