In the NSB Best practices (Best practices • NServiceBus • Particular Docs), there’s mention of two key points 1) limit number of handlers per endpoint and 2) group handlers by SLA
While I get the statements and have seen the sample on how to do it (Generic Host multiple endpoint hosting • NServiceBus Samples • Particular Docs), looking for a little guidance on how others are slicing their endpoints?
For a web-based api, I’m imagining a typical implementation is to have an endpoint for user-triggered handlers and then have a separate endpoint for background processing, which would have an api structure of something like:
- Web Api project (that registers and hosts the endpoints)
- User-focused Endpoint project
- Background Worker Endpoint project
- Domain project (that both the endpoints use)
Or is typical to go more fine grained? What kind of heuristics are used to guide slicing? If the Api consisted of multiple “features”, would you slice endpoints by feature? selective feature isolation?
Appreciate any guidance around this and get that of course it depends