In what ways does NServiceBus differ from Akka.net?

nservicebus

(Neil Barnwell) #1

I know NServiceBus fairly well, and like it a lot, though I see a lot of talk about the actor model and specifically Akka.net. However I fail to see the difference. Are handlers not analogous to actors? If both could be given a persistent storage for their incoming messages, there’s very little to tell them apart.


(William Brander) #2

Good question @neilbarnwell!

If we look at the Actor Model, an actor has 4 things: Behavior, State, A Concurrency Model, and a Message Box. If we look at what NServiceBus has in this domain, it’s almost a direct description of a Saga. A handler is perhaps a bit light in terms of state and concurrency, while the saga provides both of those.

There are a few differences between what Akka.net offers and the actor model on it’s own (routing, hierarchies, etc.), as well as what Sagas offer to the actor model (recoverability, transactions, defers, etc.) but by and large both Sagas and Akka.net can be considered working implementations of the actor model.