WCF MSMQ消费者线程数 [英] WCF MSMQ consumer thread count

查看:197
本文介绍了WCF MSMQ消费者线程数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是配置可从MSMQ队列中提取消息的最大线程数的最佳方式,在WCF中使用netMsmqBinding?

What's the best way to configure the maximum number of threads that can pull messages from an MSMQ queue, using a netMsmqBinding in WCF?

例如,说我有(不管或10,或数)的MSMQ服务,我只希望有2个工作线程拉断的消息在同一时间。

For example, say I have an MSMQ service for which I only want to have 2 (or 10, or whatever number of) worker threads pulling messages off at a time.

推荐答案

您需要的<一个href="http://msdn.microsoft.com/en-gb/library/system.servicemodel.description.servicethrottlingbehavior.aspx"相对=nofollow>服务节流

<behaviors>
 <serviceBehaviors>
  <behavior name="DefaultThrottlingBehavior">
   <serviceThrottling maxConcurrentCalls="2" />
  </behavior>
 </serviceBehaviors>
</behaviors>

这篇关于WCF MSMQ消费者线程数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆