@@ -0,0 +1,2185 @@
+package net.openhft.chronicle.queue;%0A%0Aimport net.openhft.chronicle.core.OS;%0Aimport net.openhft.chronicle.wire.DocumentContext;%0Aimport net.openhft.chronicle.wire.Wire;%0Aimport org.junit.Test;%0A%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Paths;%0A%0Apublic class Stackoveflow52274284Test %7B%0A    @Test%0A    public void fails() throws Exception %7B%0A        String basePath = OS.TMP;%0A        String path = Files.createTempDirectory(Paths.get(basePath), %22chronicle-%22)%0A                .toAbsolutePath()%0A                .toString();%0A        System.out.printf(%22Using temp path '%25s'%25n%22, path);%0A%0A        try (ChronicleQueue chronicleQueue = ChronicleQueue.single(path)) %7B%0A%0A            // Create Appender%0A            ExcerptAppender appender = chronicleQueue.acquireAppender();%0A%0A            // Create Tailer%0A            ExcerptTailer tailer = chronicleQueue.createTailer();%0A            tailer.toStart();%0A%0A            int numberOfRecords = 10;%0A%0A            // Write%0A            for (int i = 0; i %3C= numberOfRecords; i++) %7B%0A                System.out.println(%22Writing %22 + i);%0A                try (final DocumentContext dc = appender.writingDocument()) %7B%0A                    dc.wire().write(() -%3E %22msg%22).text(%22Hello World!%22);%0A                    System.out.println(%22your data was store to index=%22 + dc.index());%0A                %7D catch (Exception e) %7B%0A                    System.err.println(%22Unable to store value to chronicle%22);%0A                    e.printStackTrace();%0A                %7D%0A            %7D%0A            // Read%0A            for (int i = 0; i %3C= numberOfRecords; i++) %7B%0A                System.out.println(%22Reading %22 + i);%0A                try (DocumentContext documentContext = tailer.readingDocument()) %7B%0A                    long currentOffset = documentContext.index();%0A                    System.out.println(%22Current offset: %22 + currentOffset);%0A%0A                    Wire wire = documentContext.wire();%0A%0A                    if (wire != null) %7B%0A                        String msg = wire%0A                                .read(%22msg%22)%0A                                .text();%0A                        System.out.println(msg);%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add queue based ring buffer