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...)
发布评论
评论(1)
MSMQ 是 Windows 的一个很棒的部分。它基本上是一个面向消息的中间件,对某些软件架构有很大帮助。
这主要解决异步消息处理的常见用例:您有一个服务
Service1
,它与软件架构的另一部分(例如Service2
)进行通信(发送消息)。主要问题:如果
Service2
突然不可用怎么办?消息会丢失吗?如果您使用 MSMQ,则不会:
Service1
会将消息发送到队列中,而Service2
将在可用时出队。MSMQ 将解决以下常见问题:
Service2
不会在重负载下死亡,它只会一个接一个地出列和处理消息MSMQ的优点与另一个面向消息的中间件:
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, sayService2
.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, andService2
will dequeue when it is available.MSMQ will resolve following common issues:
Service2
won't die under the heavy load, it'll just dequeue and process messages, one after onePros of MSMQ vs another message-oriented middleware:
System.Messaging
namespace in .Net to deal with MSMQ)