views:

635

answers:

1

I wonder if it’s possible using nServiceBus to subscribe to all Messages of a Type without specifying the publisher’s end point.

The Background for this, is a distributed algorithm, that uses the distributor infra structure of nServiceBus to delegate sub problems to distributed workers on the network.

After a task is finished, the worker should send a message to notifying the sender.

I could use IBus.Reply() to notify it but I have also some monitoring and logging services, which are also interested in those messages. Making the sender republish all received replied doesn’t sound right.

Can I subscribe to a message from multiple publisher in nServiceBus?

+7  A: 

You're exactly right to use IBus.Reply - simple and works.

In order to do logging/monitoring, you'd specify where you want each endpoint to forward the messages it receives as follows:

<UnicastBusConfig ForwardReceivedMessagesTo="audit@endpoint">

That way the request at the worker will be sent there, as well as the reply that arrives at the sender.

Does that answer your question?

Udi Dahan
Thanks for the answer. It answers the question very well.
Mouk