I try to get the overview of how NServiceBus scales out in various scenarios, but I have failed to find sufficient information out there.
Generally, it seems that scaling out NServiceBus (and the underlying transport) is different in a pub/sub scenario, than in a send/receive scenario. Furthermore, it seems to play a difference whether the message emitting system(s) are scaled out or the "absorbing" systems are scaled out.
Consider a setting with MSMQ as transport layer and NServiceBus on top, and assume that we will use the queue, MyQueue
, as communication channel from an emitting system to an absorbing system (either via send/receive or pub/sub). How would a scale-out setup look like in the following scenarios? I have tried coming up with some answers below, but am not sure.
Emitting system unscaled; absorbing system unscaled: This is the trivial setup with one single endpoint at both ends, and one single queue at the receiver.
Subscription storage at both systems: MSMQ
Emitting system unscaled; absorbing system scaled: A single node at the absorbing system, the endpoint, is "promoted" as Distributor and a number of worker nodes gets messages from that single distributor node.
Does it make a difference if the absorbing system subscribes or receives?
And can the distributor be scaled out as well?
The documentation suggests using individual queue names, but isn't it messy if the sending/publishing systems should care about weather the receiving system is scaled out or not? From the sender's perspective, the receiver's scale-out should be transparent, I think.
Subscription storage at both systems: MSMQ? Where is the subscription stored? At the distributor?
Emitting system scaled; absorbing system unscaled: Multiple nodes at the emitting system can send to the unscaled absorbing system, just like in the unscaled/unscaled scenario above. But multiple nodes at the emitting system cannot (or should not) publish to the same absorbing system? Or what? How is publish from multiple nodes handled?
Subscription storage at both systems: MSMQ?
Emitting system scaled; absorbing system scaled: Is this just a combination of the above two cases for both the send/receive and pub/subscribe patterns?
Subscription storage at both systems: MSMQ?
In short, it could be nice to get an overview of how the recommended NServiceBus setup for the above four cases.