Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Publish/Subscribe With MSMQ

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.

like image 691
Jonnster Avatar asked Aug 24 '11 14:08

Jonnster


2 Answers

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.

like image 144
tom redfern Avatar answered Nov 04 '22 15:11

tom redfern


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

like image 21
rpgmaker Avatar answered Nov 04 '22 16:11

rpgmaker