MSMQ WCF life cycle on a web site

两盒软妹~` 提交于 2019-12-11 10:15:59

问题


I've created a console application that listens to a queue using WCF in the past and have no problems with that implementation.

My question:

If, instead of listening to the queue on a console application, I listen to a queue through my website, when would the message be picked up? Would it be instant, as is the case with the console app? Would the message only be received when someone requests a page on the site?

Regards.


回答1:


A website is not a good host container for a MSMQ client. The reason is the app pool unloads during time of low traffic.

So effectively you are correct in that you will not consume message until the app pool is loaded.

However, that does not prevent others from sending you messages, as the queue receives the messages regardless of whether your client is loaded or not. These would then be stored until the client came back to consume them (providing the queues are durable).

A windows service would be a much more appropriate container.



来源:https://stackoverflow.com/questions/11099921/msmq-wcf-life-cycle-on-a-web-site

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