Resequencer - stream - add predicate to allow me to supply my own gap detection
-------------------------------------------------------------------------------

                 Key: CAMEL-1371
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1371
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: Future


The resequencer stream based uses Long for gap detection as Camel then knows if 
there is a gap if eg a number in between is missing.

However sometimes you can not convert/compute a Long that is in sequence based 
on your needs.
Imagine you consume files from a folder and want them to be resequenced so you 
process them in the correct order.

The file names have this pattern: YYYYMMDD-DNNN.txt. Where YYYYMMDD is the date 
pattern and D is a fixed string and NNN is a numeric value for that particular 
day.
Eg: 20090223-D001.txt, 20090223-D002.txt ...

So if we could add a predicate to the resequencer where I could impl. the gap 
detection, then I would be able to do:
{code}
from("file://inbox").resequence(header("CamelFileName")).gapPredicate(new 
MyGapPredicate()).timeout(60000).to("bean:processFileInSequence");
{code}

Where *gapPredicate* is the new feature. Think about a better name for it, than 
gap predicate!!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to