Jakub Kubrynski
Jakub Kubrynski

Reputation: 14149

How to use PersistentQueue in Reactor?

I'm trying to configure Reactor to use Chronicle based persistence, and I cannot find by information about this in documentation. I see two ways:

  1. Create my own dispatcher supporting PersistentQueue
  2. Use EventBatcher with such queue to wrap my Reactor instance

Which option is better? Or maybe there is another solution which I overlooked?

Upvotes: 1

Views: 1161

Answers (1)

Jon Brisbin
Jon Brisbin

Reputation: 741

Reactor doesn't have persistence built into the Reactor object (which is why you're not finding documentation on it :).

If you're trying to persist the Events coming through for resiliency and replay purposes, you'll probably want to use the EventBatcher. The test for EventBatcher has some code in it that shows how to combine an Observable and a PersistentQueue.

The option of writing your own PersistentDispatcher is certainly an interesting one. That path will be fraught with danger, though, as dispatching code is unforgiving when it comes to throughput. Even the smallest of changes can have drastic impacts on throughput. We've just re-written them as well to get more performance, so the latest code in master is different from the 1.0 release versions of the Dispatchers.

I wouldn't recommend taking the Dispatcher route right away, though. I'd try the EventBatcher first and only if that can't be used in your use case would I experiment with a custom Dispatcher. There are two new abstract base classes (here and here) to base new Dispatcher implementations on if you do decide to go that route.

Upvotes: 2

Related Questions