tags:

views:

423

answers:

1

I want to deliver events from a server application to multiple clients. Since I'm using wcf to expose a service interface to the clients I gave a look in the wcf async callback mechanism, but it seems not to support dispatching one message to multiple clients. Is MSMQ a better way to implement delivery of events to multiple clients.

Thanks.

=== EDIT ===

Using MSMQ I was able to achieve what I need.

My server app creates a queue from where the clients fetch messages. A client uses the peek method provided by MessageQueue. This keeps the messages in the queue available for other clients.

To avoid filling the queue with messages, the server sends messages with the property TimeToBeReceived set with a really low value, causing the message to expire.

It's really a pity that MSMQ doesn't provide topics like JMS

=== EDIT 2 ===

After all implementing the publisher subscriber pattern in WCF is simple.

These two articles (article1,article2) describe how that can be done.

+1  A: 

What you're trying to do is called publisher subscriber multicast. No, you can't do it in WCF without writing a lot of boilerplate code. MSMQ does not support multicasting either.

Take a look at (all free and open source) NServiceBus, MassTransit or Rhino Service Bus if you can live without WCF. If you must use WCF take a look at Neuron (commercial product).

Krzysztof Koźmic