简体   繁体   English

长时间运行的WCF MSMQ处理

[英]Long running WCF MSMQ Processing

I am reading Programming WCF Services 3rd Ed. 我正在阅读WCF服务编程第三版。 by Juval Lowy. 由Juval Lowy撰写。 In the chapter "Queued Services" which covers NetMsmqBinding, On page 473, he says "... you should keep the service's processing of the queued call relatively short, or risk aborting the playback transaction. An important observation here is that it is wrong to equate queued calls with lengthy asynchronous calls." 在第473页的涵盖NetMsmqBinding的“排队服务”一章中,他说:“ ...您应该使服务对排队呼叫的处理时间相对较短,否则就有可能中止回放事务。这里的一个重要观察是,这是错误的。将排队的呼叫与冗长的异步呼叫等同起来。”

1) What is a short call? 1)什么是简短通话? 2) What is the best practice for long running operations; 2)长期运行的最佳实践是什么? send send them off to the ThreadPool? 发送将它们发送到ThreadPool?

This article ran into the same problem in practice: WCF & MSMQ & TransactionScope long process 本文在实践中遇到了相同的问题: WCF&MSMQ&TransactionScope漫长的过程

I have looked and looked, and I cannot find any best practices regarding this matter on the internet. 我看了又看,在互联网上找不到关于此问题的任何最佳实践。

3) Does this rule apply if I have no transaction? 3)如果我没有交易,此规则适用吗?

1) By default a short process with a transaction is something that takes less than 10 minutes (default transaction timeout) 2) Can be, but if you do that you will lose the transactional behavior (if the server goes down the message will be lost) 3) Yes. 1)默认情况下,一个事务的短过程少于10分钟(默认事务超时)2)可以,但是如果这样做,您将丢失事务行为(如果服务器关闭,消息将丢失)3)是的。 By default the transaction scope has a default timeout that will abort your transaction. 默认情况下,事务作用域具有默认超时,该超时将中止您的事务。

The good news is that you can override that timeout on machine.config file: http://blogs.inkeysolutions.com/2012/01/managing-timeouts-while-using.html 好消息是您可以在machine.config文件上覆盖该超时: http : //blogs.inkeysolutions.com/2012/01/managing-timeouts-while-using.html

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

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