In the application I'm working on the objects are fetched from a database. The queries use cursors. Once the query plan is ready the data arrives in a constant stream. However, at the beginning, the application pauses for a few minutes while the database is configuring the query plans etc...
I'm using an aggregator to aggregate an object I will call 'A'. A is aggregated with objects 'B' and 'C' which are both optional. So the reaper should expire A after some timeout, even if B and/or C have not arrived. A, B, C and fetched via separate cursors. Once A is known B and C are fetched subsequently.
Because of the queries mentioned, at the start of the application B and C, if they exist, will arrive a few minutes after A does. However, after that B and C will arrive within a few seconds after A since the database is now providing a constant stream of objects.
I would like to use a reaper to expire A objects but the timeout varies from minutes at the start, and then seconds later on. I thought if I could delay starting the reaper until the data flow has started up then it would work.
Any thoughts non how to start up the reaper based on some application event? I did notice the control bus section in the manual but I'm not sure if that applies.
Or perhaps there is another approach that would work?