1
  1. Write data to Chronicle queue.
  2. This creates/updates the chronicle queue file and is written in 20220525F.cq4

Query :- Is it possible to parse the file 20220525F.cq4 , what is the data format used to write the file ?

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130

2 Answers2

1

You can use the chronicle queue tailer to read the contents of a chronicle queue, or net.openhft.chronicle.queue.ChronicleQueue#dump() to dump the queue out as text, but apart from the tools offered by Chronicle-Queue, there is no simple way to parse the queue file.

Rob Austin
  • 620
  • 3
  • 5
0

If you don't want to use the built-in tools, and you are happy to read the file very simply, you can read it. The main tools for dumping are in Chronicle Wire if you don't want to use Chronicle Queue.

The file is size prefixed bytes. The first 4 bytes are the length, followed the data in that blob. This repeats until you reach a length of 0.

https://github.com/OpenHFT/RFC/blob/master/Size-Prefixed-Blob/Size-Prefixed-Blob-1.0.adoc

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • I see the initial part of file has Á @¹header¶SCQStore‚ª ÍwritePositionŽ How should I decode this. Is this existing code I can reuse ?? – Abhishek Sharma May 25 '22 at 16:34
  • Looking out to :- Looking out for reverse engineering, If I write to a chronicle queue file will it be automatically picked up by the chronicle queue, For e.g If I append the record "Hello World" to chronicle file will the trailer application reading from queue automatically be able to read this data – Abhishek Sharma May 26 '22 at 04:59
  • @AbhishekSharma The first 4 bytes is the header. The length is the bottom 30 bits of that. I suggest you the open-source libraries to decode it at first. There is now 3 different ways to do this built-in. – Peter Lawrey May 26 '22 at 18:40
  • @AbhishekSharma If you do it correctly, the tailer can pick up the write within 200 ns. – Peter Lawrey May 26 '22 at 18:41