I am using Chronicle Queue v4.5.15. I have created a method to tell me the number of elements that are in the queue:
public long getQueueSize() {
long index = getQueueIndex(); // I store the index in a persistent map so this method simply retrieves the current index from the map.
ExcerptTailer tailer = queue.createTailer();
long lastIndex = tailer.toEnd().index(); // Get the last index in our queue.
long count = queue.countExcerpts(queueIndex, lastIndex);
return count
}
I ran a test overnight and my component had a cq4 queue file written for the 22nd of December. It is on a daily cycle. I tried adding some elements to the queue today and there is an exception thrown 'IllegalStateException: 'file not found' for the upperCycle, file ../path_to_queue/20161314.cq4
.
Stacktrace:
Caused by java.lang.IllegalStateException: java.lang.IllegalStateException: 'file not found' for the upperCycle, file=/var/tmp/app/20161224.cq4
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueue.countExcertps(SingleChronicleQueue.java:359(
at ...
Seeing as its the 23rd of December today, why is Chronicle looking for a file in the future?
Could it be something to do with the way I get the last index?
Thanks
Could you retest with the last version - I've added the following test case, which passes.
see: RollingChronicleQueueTest