On 13.01.14 15:26, Vadim Bobrov wrote:
There are numerous ways (impl options) for resending messages.
Using a channel is only one.
Other than persistent channel what are the options?
In akka-persistence, channels are the only option, outside
akka-persistence, anything that can store messages re-send them if needed.
I actually believe it is important to note in the documentation that messages
in mailbox are not preserved by a processor, it was not obvious to me until I
ran a couple of tests.
From the docs:
"When a processor's receive method is called with a Persistent message
it can safely assume that this message has been successfully written to
the journal."
I think the above sentence makes that clear. If not, please make a
proposal in this thread or create a pull request.
Actually can you advise me to a design decision? Suppose I have an actor A that
receives (from outside) a lot of messages per sec. It transforms them and sends
to actor B that saves them to a database. The goal is to make sure that no
information is lost in the case of a crash and no message is sent twice. In
addition to it the journal must not grow uncontrollably. How would you
implement this? Two processors and a persistent channel in between, snapshots
and deleteMessages to control journal growth?
A single persistent channel (actor A) and a channel destination (actor
B) should be enough.
- actor A clients know from a channel's persistentReply=true that a
message has been successfully written/queued.
- actor B receives messages from A and is responsible for detecting
duplicates by tracking sequence numbers (when actor B is started it
should load the latest successfully saved sequence number from the
database).
- when actor B has successfully saved a message to the database, it can
confirm message delivery (which asynchronously removes it from the
journal - preventing unlimited journal growth).
Alternatives:
- write to the database directly (if fast enough)
- use a 3rd-party persistent messaging server
--
Martin Krasser
blog: http://krasserm.blogspot.com
code: http://github.com/krasserm
twitter: http://twitter.com/mrt1nz
--
Read the docs: http://akka.io/docs/
Check the FAQ: http://akka.io/faq/
Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.