chronicle-queue

Regarding sub-topics in chronicle queue

孤人 提交于 2020-06-01 05:52:20
问题 I'm looking to write messages to a single queue. I'd like to use the sub-topics functionality, so that tailers can pick and choose either to read all of the sub-topics under one topic, or pick specific sub-topics to read from. The documentation mentions that sub-topics are supported in a directory under the main topic, so in order to read from a subtopic, do we just create a new queue and point it to the sub-topic path? SingleChronicleQueue queue = SingleChronicleQueueBuilder.binary("Topic")

Chronicle Consumer not reading records correctly?

时光毁灭记忆、已成空白 提交于 2020-02-05 21:26:48
问题 I am using chronicle-queue (5.16.13) to write and read json values to a chronicle file. To write objects I use the following in a loop try (final DocumentContext dc = appender.writingDocument()) { dc.wire().write(() -> "msg").text("Hallo asdf"); System.out.println("your data was store to index="+ dc.index()); return true; } catch (Exception e) { logger.warn("Unable to store value to chronicle", e); return false; } and to read items I do the following call in a loop DocumentContext

Chronicle queue + log4j2 async logger

放肆的年华 提交于 2019-12-20 05:39:15
问题 I use log4j2 2.10.0 and have the following code: SingleChronicleQueue q = SingleChronicleQueueBuilder.binary(args[0]).blockSize(536870912).build(); ExcerptAppender a = q.acquireAppender(); char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray(); StringBuilder sb = new StringBuilder(); Random random = new Random(); for (int i = 0; i < 1000; i++) { char c = chars[random.nextInt(chars.length)]; sb.append(c); } String t = sb.toString(); for (int i = 0; i < 1000000; i ++ ) { m_logger.info(i + "

Chronicle Queue: StoreFileListener multiple onAcquired and onReleased

折月煮酒 提交于 2019-12-13 01:08:07
问题 I am using Chronicle 4.5.27. Below is simple implementation for Writer and Reader with StoreFileListner. In Reader I am getting multiple onAcquired and onReleased events. Why will this happen? I am expecting to receive only one Acquire (when file is acquired for reading) and one Release (after read is complete). In the below logs for Reader once can see multiple of onAcquired and onReleased events. Please note this behaviour is random. Also note Writer has been deliberately slowed down with

Reading message from chronicle queue does not move the current index to the next cycle automatically

北城余情 提交于 2019-12-12 03:49:33
问题 Reading message from chronicle queue does not move the current index to the next cycle automatically. I get the following logs messages: 697917 [SCHEDULER#4] INFO net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts - Rolled 2 times to find the next cycle file. This can occur if you appenders have not written anything for a while, leaving the cycle files with a gap. What does this means? My queue files are : 20160824.cq4 20160826.cq4 20160829.cq4 20160830.cq4. The 20160825.cq4

ChronicleQueue - Unable to cleanup older CQ4 files

五迷三道 提交于 2019-12-11 16:16:19
问题 I am using CronicleQueue and I have only one writer/reader. Wanted to cleanup as soon as the reader is done with a CQ4 file. The following code wasn't able to remove the file, is the file reference still held by CQ during onReleased() event? public class ChronicleFactory { public SingleChronicleQueue createChronicle(String instance, String persistenceDir, RollCycles rollCycles) { SingleChronicleQueue chronicle = null; String thisInstance = instance; try { chronicle =

chronicle vs chronicle-queue package

痞子三分冷 提交于 2019-12-11 07:47:45
问题 I'm just getting started with chronicle queue - however I'm a bit confused on which API to use for reading/writing to the queue. Specifically chronicle-queue-5 vs chronicle-3.5.* I've gone through this link which basically uses chronicle-queue API , but there are others like this which uses chronicle. What is the difference between these 2 below? Chronicle chronicle = ChronicleQueueBuilder.indexed(_location).build(); ExcerptAppender appender = chronicle.createAppender(); appender.startExcerpt

I have created a single queue with daily rolling

前提是你 提交于 2019-12-11 07:20:28
问题 I have created a single queue with daily rolling. On the next day, I can't read the latest appended message. I found that the tailer index doesn't move to the latest cycle automatically after reading all messages in the previous cycle. By the way the java process was shut down at night and restarted on the next day. I use Chronicle Queue V4.52. Thanks. 回答1: This should work, we have tests which show messages are read from one cycle to the next. Would you be able to include a test which

Chronicle queue + log4j2 async logger

别等时光非礼了梦想. 提交于 2019-12-02 11:30:39
I use log4j2 2.10.0 and have the following code: SingleChronicleQueue q = SingleChronicleQueueBuilder.binary(args[0]).blockSize(536870912).build(); ExcerptAppender a = q.acquireAppender(); char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray(); StringBuilder sb = new StringBuilder(); Random random = new Random(); for (int i = 0; i < 1000; i++) { char c = chars[random.nextInt(chars.length)]; sb.append(c); } String t = sb.toString(); for (int i = 0; i < 1000000; i ++ ) { m_logger.info(i + " " + t); a.writeText(t); } Both the cq4 and the log is writing to the same dir. And in the log, it was