I have:
- one subscriber SUB with QUEUE0
- publisher PUB1 with QUEUE1
- publisher PUB2 with QUEUE2
- event MyEvent
being published by both publishers
When:
- SUB explicitly subscribes to PUB1 with queue name QUEUE1 only
subscriberEndpointConfiguration.UnicastRouting().AddPublisher("PUB1", typeof(MyEvent));
Outcome:
- SUB also receives MyEvent
from PUB2 (which has queue name QUEUE2)
Expected:
- SUB should not receive MyEvent
from PUB2, because it's not subscribed to that publisher queue name
From NSB wiki:
subscribers express interest in one or more classes, and only receive messages that are of interest, without knowledge of what, if any, publishers there are
Questions:
What's the point of specifying the publisher endpoint in the
AddPublisher
method shown above? The Subscription table in the Azure Table Storage has an event type and a subscriber columns only, publisher endpoint is not stored.If
AddPublisher
is some sort of an obsolete method, then theendpointInstance.Subscribe<MyEvent>()
simply fails - it says "no publishers could be found".Is it possible to scope/group publishers so having only one event type
MyEvent
the subscribers will receive that events from publishers which are created with the same queue name only?
E.g. you create PUB1 with QUEUE-A, PUB2 with queue QUEUE-A, PUB3 with QUEUE-B, and SUB withAddPublisher
to QUEUE-A, so the SUB does not receiveMyEvent
from PUB3 (QUEUE-B).
I'm using:
NServiceBus 6.0.0-beta0004
NServiceBus.Persistence.AzureStorage 1.0.0-beta0004
NServiceBus.Azure.Transports.WindowsAzureStorageQueues 7.0.0-beta0004
IEndpointInstance
? (basically in the same host). And are they using the same Persistance Configuration :busConfiguration.UsePersistence<AzureStoragePersistence, StorageType.Subscriptions>().TableName("tableName")
? I think each Publisher will not only need it's own Queue (to receive in coming subscription messages), but its own Persistence table to store the subscriptions. I don't think Publishers can share a table without bleed over. – Philip Pittle