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.
Message Queuing (MSMQ) technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. Applications send messages to queues and read messages from queues.
Message queues provide communication and coordination for these distributed applications. Message queues can significantly simplify coding of decoupled applications, while improving performance, reliability and scalability. You can also combine message queues with Pub/Sub messaging in a fanout design pattern.
Conclusion. Message queues offer significant advantages over RPCs in distributed systems. Whereas RPCs are synchronous and unreliable, message queues are asynchronous and reliable. They add complexity both to application design and operations, but that complexity can be managed.
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:
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)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With