Skip to content

Reading the Chronicle after a shutdown

Jan Nielsen edited this page Mar 19, 2020 · 4 revisions

Q. How to read a Chronicle after a shutdown? Let's say my Chronicle Reader Thread dies. When the reader thread is up again, how do we ensure that the reader will read from the point where he left off.

A. There is a number of solutions. You can:

  • write the results of the message to an output queue with meta data like timings and the source index. If you reread the output to reconstruct your state you can also determine which entry was processed, i.e. replay any entries read but for which there was no output.
  • you can mark entries on the input, either for load balancing or timestamp in when the entry was read. The last entry read can be found by finding the first entry without a time stamp. You can use the binary search facility to do this efficiently.
  • you can record the index of the last entry processed in a ChronicleMap.
  • you can reread all the entries and check via some other means whether it is a duplicate or not.