开发者

Bulk calls vs multiple calls in WCF using MSMQ

开发者 https://www.devze.com 2023-03-31 20:43 出处:网络
I am calling a WCF service which contains the business logic to process the message objects. I need to pass the id of the message to开发者_StackOverflow中文版 WCF service. We are using MSMQ for queui

I am calling a WCF service which contains the business logic to process the message objects.

I need to pass the id of the message to开发者_StackOverflow中文版 WCF service. We are using MSMQ for queuing up the requests.

There could be multiple messages that WCF service need to process which can be handled as follows

  1. Send the message id one by one
  2. Send array of message ids and then WCF service will iterate through each id and process the message object.

Performance point of view I believe second option is better as multiple requests to WCF are not there.

Is my assumption correct?

- Ram


Number 2 is more efficient in terms of latency but does not give you the chance to spread the processing load by having multiple queue readers

Also be aware that if you use a transactional queue and sessions then WCF may put more than one SOAP message in each MSMQ message

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号