Key Benefits of MSMQ

百般思念 提交于 2019-11-29 02:57:38

问题


I have seen many socket application in which there is use of MSMQ. But when I go in details I think that we can do it without MSMQ also, so I want to know what is key benefit of MSMQ. Why should someone use MSMQ in his own application.


回答1:


MSMQ is a great piece of Windows. It is basically a message-oriented middleware that helps a lot in some software architectures.

This mainly addresses the common use case of asynchronous message processing: you have a service Service1 that communicates (send messages) with another part of your software architecture, say Service2.

Main problem: what if Service2 becomes suddenly unavailable? Will messages be lost? If you use MSMQ it won't: Service1 will send messages into a queue, and Service2 will dequeue when it is available.

MSMQ will resolve following common issues:

  • temporary unavailability of a service: messages are persisted on the disk and will be dequeued when the service becomes available again, so no messages are lost
  • as it's fully asynchronous, it'll help a lot in case of punctual peak load: your Service2 won't die under the heavy load, it'll just dequeue and process messages, one after one

Pros of MSMQ vs another message-oriented middleware:

  • free and built-in (shipped with Windows)
  • light
  • good integration with other Microsoft products (for instance there is the System.Messaging namespace in .Net to deal with MSMQ)
  • monitoring capabilities (using perfmon counters: number of message received per second...)
  • transactional queues
  • persistence on disk so messages are never lost
  • available through the network (remote queues)


来源:https://stackoverflow.com/questions/9077598/key-benefits-of-msmq

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