Scenario: A subscriber subscribes to an event type, but in practice actually ignores all but 5% of the messages.
This seems at the very least wasteful, but at the worst a problem that could cause MSMQ quotas to be exceeded, affecting other services using MSMQ.
What are suitable/NServiceBus-idiomatic ways to resolve this?
- Don’t worry about it, as long as you’re always careful to ignore messages for the simplest reasons first.
- Filtering at the publisher on more than just event type. I don’t like this as it couples publisher and subscriber and effectively makes it a broker system where the thing in the middle (publisher) knows too much.
- Create more specific message types somehow. Again feels like coupling as you’re changing the publisher to suit a specific subscriber.
- Topic-based subscriptions (which would have to be hand-rolled as NSB doesn’t support them as such, though I’m sure hooking into the subscription control message sending/handling and doing something in the headers could be made to work).