anuni
anuni

Reputation: 999

Using Chronicle-Queue as a file based FIFO queue

I got to know Chronicle-Queue from post: Implementing a file based queue

Here's my use case:

Based on above use case, I have below questions:

  1. How many appenders should be used? Multiple threads share 1 appender or each thread has its own appender?

  2. is queue.acquireAppender() a heavy operation? Shall I cache the appender to avoid calls to acquireAppender()?

  3. If for some reason server is down, can tailer remember the last success read entry and continue with next entry ? (like a millstone feature)

  4. How can I purge/delete old files? Any API to do the purge?

And another irrelevant question:

Is it possible to use Chronicle-Queue to implement a file based BlockingQueue?

Thanks

Leon

Upvotes: 1

Views: 377

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533492

How many appenders should be used? Multiple threads share 1 appender or each thread has its own appender?

I suggest you use queue.acquireAppender() and it will create Appenders as needed.

is queue.acquireAppender() a heavy operation? Shall I cache the appender to avoid calls to acquireAppender()?

It's not free but costs a ~100 of nanoseconds.

If for some reason server is down, can tailer remember the last success read entry and continue with next entry ? (like a millstone feature)

We suggest recording to another queue the outcomes of processing the first queue. In this you can record the index it is up to. This is a feature we are considering without the need to add a queue.

How can I purge/delete old files? Any API to do the purge?

If you set a StoreFileListener on the builder you can be notified when a file isn't needed any more.

Upvotes: 0

Related Questions