I have a variety of message handlers that I am porting to NServiceBus from the MSMQ Binding for WCF. To preserve the concurrency characteristics of the existing handlers, we want each handler to process its commands serially, but also to run at the same time as other handlers so some are not starved by slow-running tasks. The first thing we’ve thought of is to make them all different endpoints with a concurrency limit of 1. (That’s what I’m callling ‘sharding’ in the post title)
However, because they’ve always been part of the same logical service as each other, some of the same events are published by multiple handlers. A given event is only supposed to by published by a single logical endpoint, correct?
So, how should we accomplish this sharding? Is it necessary to have the handlers shovel the events they want to publish over to some central publishing endpoint?