So i've discovered SnapshotMode.INITIAL_ONLY which appears to be exactly what I need except that then the embedded engine spins forever:
2017-07-20 17:57:33 DEBUG EmbeddedEngine:648 - Embedded engine returned from polling task for records
2017-07-20 17:57:33 DEBUG EmbeddedEngine:684 - Received no records from the task
2017-07-20 17:57:33 DEBUG EmbeddedEngine:646 - Embedded engine is polling task for records on thread Thread[pool-4-thread-1,5,main]
2017-07-20 17:57:33 DEBUG EmbeddedEngine:648 - Embedded engine returned from polling task for records
2017-07-20 17:57:33 DEBUG EmbeddedEngine:684 - Received no records from the task
2017-07-20 17:57:33 DEBUG EmbeddedEngine:646 - Embedded engine is polling task for records on thread Thread[pool-4-thread-1,5,main]
2017-07-20 17:57:33 DEBUG EmbeddedEngine:648 - Embedded engine returned from polling task for records
2017-07-20 17:57:33 DEBUG EmbeddedEngine:684 - Received no records from the task
2017-07-20 17:57:33 DEBUG EmbeddedEngine:646 - Embedded engine is polling task for records on thread Thread[pool-4-thread-1,5,main]
etc ...
I'd be happy to submit a patch with a little guidance from the maintainers on how best to break that loop. Some possibilities I'm considering are:
- Making ChainedReader return a sentinel record and modifying EmbeddedEngine to check for it