使用事务性时 WCF MSMQ 服务不重试
我有一个 wcf 服务,它托管在 Windows 2003 服务器上的 Windows 服务中,该服务器正在侦听 MSMQ 队列。我在 netmsmqbinding 上设置 ReceiveRetryCount = 2。该服务设置为使用事务 ([OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete= true)])。该服务运行良好。
由于数据库调用不支持 MSDTC,我需要关闭事务。因此,我将服务属性切换为
[OperationBehavior(TransactionScopeRequired = false)]
“现在”,当引发异常或故障时,不会发生重试,该服务的故障处理程序永远不会触发。原始消息最终进入系统 DLQ。我希望故障处理程序在两次重试后处理故障。有什么想法吗?
I have a wcf service that I am hosting within a windows service on a windows 2003 server that is listening on a MSMQ queue. I set the ReceiveRetryCount = 2 on the netmsmqbinding. The service was setup to use transactions ([OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete= true)]). The service was functioning great.
I needed to turnoff the transactions due to a database call that couldn't support MSDTC. So I switched the service properties to
[OperationBehavior(TransactionScopeRequired = false)]
Now, when an exception or fault is thrown, no retry occurs, the fault handler for the service never fires. The original message ends up in the system DLQ. I would like the fault handler to handle the faults after two retries. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将事情恢复到以前的样子。
在数据库调用周围,添加以下内容(代码是根据内存完成的 - 如果我需要稍微修复一下,请告诉我):
Switch things back to the way they were before.
Around the database call, add the following (code is done from memory- let me know if I need to fix this up a bit):