简体   繁体   English

WCF使用MSMQ发布/订阅

[英]WCF Publish/Subscribe With MSMQ

I have created a WCF Publish/Subscribe service using WSDualHTTPBinding. 我使用WSDualHTTPBinding创建了WCF发布/订阅服务。 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. 我的代码与MSDN上的基于列表的发布订阅示例完全相同。

http://msdn.microsoft.com/en-us/library/ms752254.aspx 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. 考虑到接收消息的顺序并不重要,我认为使用MSMQ会更加可靠。

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. 据我所知,在app.config中替换netMsmqBinding是不够的,因为所有的servicecontracts必须是一种方式,在上面的例子中它们不是。 Is it possible to create the publish/subscribe pattern in MSQM and if so how. 是否可以在MSQM中创建发布/订阅模式,如果是这样的话。 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. MSMQ绑定不支持此功能。 However, if you want to go the framework way try NServiceBus. 但是,如果你想以框架的方式尝试NServiceBus。

http://docs.particular.net/samples/pubsub/ http://docs.particular.net/samples/pubsub/

NServiceBus sits on top of MSMQ. NServiceBus位于MSMQ之上。

您还可以试用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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM