WCF MSMQ消费者线程计数
-
03-10-2019 - |
题
使用WCF中的NetMSMQBinding,配置最大线程数量的最大线程数量的最佳方法是什么?
例如,假设我有一个MSMQ服务,我只想有2个(或10个或任何数量的)工作线程一次拉消息。
解决方案
你需要 服务节流
<behaviors>
<serviceBehaviors>
<behavior name="DefaultThrottlingBehavior">
<serviceThrottling maxConcurrentCalls="2" />
</behavior>
</serviceBehaviors>
</behaviors>
不隶属于 StackOverflow