使用WCF中的NetMSMQBinding,配置最大线程数量的最大线程数量的最佳方法是什么?

例如,假设我有一个MSMQ服务,我只想有2个(或10个或任何数量的)工作线程一次拉消息。

有帮助吗?

解决方案

你需要 服务节流

<behaviors>
 <serviceBehaviors>
  <behavior name="DefaultThrottlingBehavior">
   <serviceThrottling maxConcurrentCalls="2" />
  </behavior>
 </serviceBehaviors>
</behaviors>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top