Akka bus: find unoccupied events in the channel?

If an actor starts up and subscribes to a channel in Bus Bus Akka, is there any way for an actor to use events that have already been sent to the channel but not absorbed by any other actor?

In other words, I want the actor to "collect mail." Maybe Event Bus is wrong for this, I don't know.

+4
source share
1 answer

If the channel is not subscribed, messages are sent to the DeadLetter channel. In theory, you could write a custom actor and subscribe to the Deadletter event stream (look at the magazine artist for DeadLetter) to keep track of all misunderstood messages. You can have a size reference ("last message box") in the actor for each channel and make it listen to the user channel "mail". A mailbox queue can also be based on external persistence (redis, rdbs, etc.). Each new subscriber for your channel must check the "mail" channel and consume all messages from a certain order of topics in the mail actor, if any. This emulates the next message queue for any broker that supports persistence.

+4

Source: https://habr.com/ru/post/1527231/


All Articles