0

We are trying Chronicle HFT as a proof of concept for low latency messaging b/w components. We are using chronicle-1.7.2.jar

We have a reader and writer, writer keeps writing excerpts to chronicle and reader keeps reading it in a busy while loop.

We are having trouble to hook reader on epoll and make it selectable when there is data available in the chronicle file. Usually we select on DatagramChannel data availability.

Please shed some light on how to make the reader selectable and register a call back when there is data written on chronicle.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
Srujan Kumar Gulla
  • 5,721
  • 9
  • 48
  • 78

1 Answers1

2

A key feature of Chronicle Queue is it avoids involving the operating system wherever possible. Even one system call would typically take 10x as long as passing a simple message between processes.

In your case, you could add a background thread which monitors the queue and triggers Selector to wake up.

I would recommend using Chronicle Queue v4.4.3 (or the latest)

http://search.maven.org/#search%7Cga%7C1%7Cchronicle%20queue

In particular I would suggest you read my posts on Microservices.

http://vanilla-java.github.io/tag/Microservices/

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • Thanks peter. I agree that system calls are very slow b/w processes. But we are operating on a single threaded applications. One VM per core. Any suggestions? I am not able to find much documentation on chronicle as well can you pl point me to some sources other than gitbut listed one – Srujan Kumar Gulla Jun 13 '16 at 22:55
  • @SrujanKumarGulla I would start with the github docs and the unit tests as examples. https://github.com/OpenHFT/Chronicle-Queue The article on Microservices and the example programs have most of the code you need to know. – Peter Lawrey Jun 13 '16 at 23:23