WCF MSMQ consumer thread count

末鹿安然 提交于 2020-01-05 09:33:43

问题


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?

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.


回答1:


You need Service Throttling

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


来源:https://stackoverflow.com/questions/2767140/wcf-msmq-consumer-thread-count

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!