At-Least-Once delivery without persistence

I need at-least-once delivery for certain Akka Actor messages, but without persistence. That is, by design the sending actor’s state should be lost after a restart of the application/node, and I am only after the retry-logic.

The trait AtLeastOnceDelivery extends PersistentActor, so there is no way to use it without Event Sourcing, persistenceId, etc. That’s fine, as long as persistence mechanics can be avoided.

What would be the be the best way to implement at-least-once delivery without persistence? Can I just

  • mix in AtLeastOnceDelivery and use its deliver and confirmDelivery methods
  • avoid calls to persist,
  • treat receiveCommand like a “normal” receive method,
  • make receiveRecover a no-op

or will that cause undesirable side-effects? - such as unwanted entries for each actor in my journal.

Or is it better to write my own implementation?

Thanks a lot

Ps: Cross posting here - will keep in sync

Personally I think the simplest solution is to forgo any persistent layer and define your own “ack protocol”.

I’m not so sure, but maybe the pattern is already clearly explained with actors somewhere else, but the idea is simply that the receiving actor must reply with a message, asserting it received the original message (should be identifiable and the id should be in the ack).
The sender needs to retry (with an arbitrary policy you want to choose) until an ack is received.

There might be other pre-canned solutions, but you might find them starting a search about what I outlined, I suppose.