Search code examples
chronicle-queue

Iterator over Chronicle Queue implementation


I'm looking to implement an Iterator<> on a ChronicleQueue methodReader (or tailer if this cant be done with a methodReader).

Is there a way to see if a queue has more data ( can I use lastReadIndex() < ??? ) (so I can implement the hasNext() of the Iterator?


Solution

  • You can read the next excerpt to see if one exists, hasNext() can return true if it finds one, and next() can return the message you last read.