I have created a WCF Publish/Subscribe service using WSDualHTTPBinding. It allows a server application to submit errors to it and then all clients that are subscribed will receive the error messages. This works but after a while it will stop working stating that the reliable session has faulted. I've spent too long looking into this and wasted too much time.
My code is exactly the same as the List Based Publish Subscribe example on the MSDN.
http://msdn.microsoft.com/en-us/library/ms752254.aspx
I was thinking that using MSMQ for this would be more reliable considering the order the messages are received is not important.
From what I can tell, replacing with netMsmqBinding in the app.config is not sufficient as all servicecontracts must be one way which in the example above they are not. Is it possible to create the publish/subscribe pattern in MSQM and if so how. I have seen a few examples but they were difficult to follow and were inconclusive as to whether it was a good approach.
MSMQ binding will not support this. However, if you want to go the framework way try NServiceBus.
http://docs.particular.net/samples/pubsub/
NServiceBus sits on top of MSMQ.
You can also try out Phoenix Service Bus: http://pservicebus.codeplex.com/ Sample PubSub: http://pservicebus.codeplex.com/SourceControl/changeset/view/e1c0eec063e9#pServiceBus%201.0.2%2fSamples%2fChatApp%2fProgram.cs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With