views:

263

answers:

1

I am looking at various options for a WCF based publish subscribe framework. Say I have one WCF web service that will be the publisher and 1000 clients registered as subscriber. For some published messages all clients will be interested but at the same time I wish the ability to notify a single client with a specific message. On receiving notification the client will call other web service methods on the web service.

Is NServiceBus suitable for this kind of scenario ? If I use MSMQ for transport does it mean that every PC where the client is installed requires a queue to be created ?

+2  A: 

Some of the challenges include how you want the publisher to behave when a given subscribing client is down - do you want that message to be available when the subscriber comes back up? If so, then some kind of durable messaging is needed between them - like MSMQ.

Your question about notifying a single client, is that as a result of a request sent by that client? If so, then standard NServiceBus calls in the form of Bus.Reply will do it for you. When using WCF, if the response is to be asynchronous you'll need to use callback contracts.

NServiceBus can do all the things you described, and has the ability to automatically install MSMQ and create queues so that greatly simplifies client-side deployments.

You also have the ability with NServiceBus to expose messages over WCF so you can support non-NServiceBus clients if you need to as well. It also has its own http gateway and XSD schemas which can allow clients on non-Windows platforms to interoperate even without using WCF.

Hope that answers your questions.

Udi Dahan
If subscriber is down then I don't want the message to be available when it comes back up. But say each subscriber registers with a uniqueId. Then the scenario is that the publisher should be able to notify to a particular subscriber based on the id that this message is for you. I thought of turning each client into a WCF service as well and it registers with the publisher with a uinqueId and endpoint url that the publisher can call. But if NServiceBus can handle this scenario I would be happy to investigate further.
Pratik
If you configure the subscriber as a client then it will discard messages in its queue at startup. You can try implementing this yourself with WCF but NServiceBus handles it by itself. You can store the client address and Bus.Send(clientAddress, someNotification); whenever you like.
Udi Dahan