I have two systems, call them A and B. When some significant object changes in A, A sends it to B through Apache Camel. However, I encountered one case, when A actually has change log of an object, while B must reflect only actual state of the object. Moreover, change log in A can contain "future" records. It means, that object's state change is scheduled on some moment in the future. A user of the system A can edit this change log, remove change records, add new change records with any timestamp (in the past and in the future) and even update existing changes. Of course, A sends these change records to B, but B needs only actual state of the object.
Note, that I can query objects from A, but A is a performance-critical system, and I therefore I am not going to query something, as it can cause additional load. Also, API for querying data from A is overcomplicated and I would like to avoid it whenever possible.
I can see two problems here. First is realizing whether the particular change in change log record may cause changing of the actual state. I am going to store change log in an intermediate database. As a change log record comes, I am going to add/remove/update it in the intermediate database and then calculate actual state of the object and send this state to B.
Second is tracking change schedule. I couldn't invent anything except for running a periodical job in a constant interval (say, 15 minutes). This job would scan all records that fall in the time interval from the last invocation until the current invocation.
What I like Apache Camel for is its component-based approach, when you only need to connect endpoints and get everyting work, with only a little amount of coding. Is there any pre-existing primitives for this problem both in Apache Camel and in EIP?