miguel
miguel

Reputation: 714

How to correctly use Akka's Event Stream?

I've been using Akka's event stream in a Play app as an event bus where I can publish events and subscribe listeners and I wanted to know what are the gotchas I should take into account. Specifically there are two things:

Upvotes: 6

Views: 1866

Answers (1)

Grzesiek
Grzesiek

Reputation: 120

Considering constraints I would not use Akka's event bus for this purpose.

Main reasons are:

  1. Delivery - You have no guarantees that event listeners are in fact listening (no ACK). It's possible to lose some events on the way.
  2. Persistance - There is no built in way of preserving event bus state.
  3. Scaling - Akka's event bus is a local facility, meaning it's not suitable if in future you would like to create a cluster.

Easiest way to deal with that would be to use message queue such as RabbitMQ. While back I was using sstone/amqp-client. MQ can provide you with persistent queues (queue for each listener/listener type).

Upvotes: 2

Related Questions