嗨,我正在使用以下队列版本,
chronicle-queue.version : 4.5.15
chronicle-wire.version : 1.7.14
我的 Chronicle 阅读器在某个时刻卡住了(索引 74204158352345 )并且 readDocument 在每次调用后返回 false,但我的 Chronicle 编写器继续将消息写入同一个队列。阅读器代码如下,
ChronicleQueue queue = ChronicleQueueBuilder.single(chroniclePath).build();
excerptTailer = queue.createTailer();
excerptTailer.readDocument(document);// Marshallable document
我在 while 循环中调用 readDocument。日志中没有编年史错误。但是我的代码在来自编年史队列的最后一条消息上刹车,因为该消息不完整。我只得到了最后一条消息的一些字节,并且在 readDocument 返回 false 之后。但是有消息不断写入队列。
我的作家代码,
public void init() {
queue = ChronicleQueueBuilder.single(chroniclePath).build();
appender = queue.acquireAppender();
}
public void write(T document) {
appender.writeDocument(document);
}
public void destroy() {
if (queue !=null && queue.isClosed()) {
queue.close();
}
}
4.5.27 & 1.7.32
我尝试在本地机器上将队列升级到最新的(
Exception in thread "Chronicle Reader" java.lang.StackOverflowError
at java.lang.ThreadLocal$ThreadLocalMap.getEntry(ThreadLocal.java:414)
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:298)
at java.lang.ThreadLocal.get(ThreadLocal.java:163)
at java.lang.StringCoding.deref(StringCoding.java:63)
at java.lang.StringCoding.encode(StringCoding.java:330)
at java.lang.String.getBytes(String.java:918)
at java.io.UnixFileSystem.checkAccess(Native Method)
at java.io.File.canWrite(File.java:796)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.isReadOnly(SingleChronicleQueueExcerpts.java:798)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1006)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.inACycle(SingleChronicleQueueExcerpts.java:1007)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreTailer.checkMoveToNextCycle(SingleChronicleQueueExcerpts.java:1055)
etc...
在新版本中,readDocument 方法被挂起。可能挂在递归上。可能是什么问题,请帮忙。