Multiple routing best practice?

I have a test container so as to learn how to use this software. I am at the point now where I need to be able to send messages to multiple subscribers… is there a good example on how to do this…

client
|-----> subscriber a
|-----> subscriber b
|-----> subscriber c

Thanks

Hi Kevin,

Have a look at our documentation about pub/sub:

And the available samples:

Cheers,
.m

So… am I reading correctly to subscriber I have to have a handler in my endpoint that implements my “sub” message classes?
eg:
Endpoint1Hndlr.IHandleMessage< someMessageClass>
Endpoint2Hndlr.IHandleMessage< someMessageClass>
Endpoint3Hndlr.IHandleMessage< someMessageClass>

Is this correct?

I could also create a publisher in my handler that reacts when i receive the message for the subscription im watching?

Hi Kevin,

That’s corerct with auto-subscription turned on by default. If no auto-subscription is enabled, then a manual subscription is required. See more information here: Controlling What Is Subscribed • NServiceBus • Particular Docs.

Not sure I follow this question. If you meant you could also publish a message within a handler that has received another event, then correct.

Sean

1 Like