What is Microsoft Message Queuing (MSMQ)? How it works?

I need to work with MSMQ (Microsoft Message Queuing). What does it work for, how does it work? How is this different from web services?

+47
msmq
Dec 30 '09 at 12:03
source share
9 answers

As stated in his name, this is just a queue manager.

You can send objects (serialized) to the queue where they will remain until you receive them. It is commonly used to send messages or objects between applications in an untied way.

This has nothing to do with web services, these are two different things.

MSMQ Information :

https://msdn.microsoft.com/en-us/library/ms711472(v=vs.85).aspx

Web Services Information :

http://msdn.microsoft.com/en-us/library/ms972326.aspx

+39
Dec 30 '09 at 12:09
source share

With all due respect to @Juan's answer, both ways of exchanging data between two disconnected processes, i.e. interprocess communication channels (IPC). Message queues are asynchronous and web services synchronous. They use different protocols and support services for this, so they are completely different in implementation, but similar in purpose.

You would like to use message queues when it is likely that another communication process might not be available, but you still want the message to be sent during client selection. Delivery will occur when the process at the other end wakes up and receives a notification that a message has arrived.

+46
Dec 30 '09 at 12:20
source share

Transactional Queue Management 101

A transactional queue is a middleware system that asynchronously routes messages of one type to another between hosts that may or may not be connected at any given time. This means that he must also be able to save the message somewhere. Examples of such systems are MSMQ and IBM MQ

A transactional queue can also participate in a distributed transaction , and rollback can initiate deletion of messages. This means that the message will be guaranteed to be delivered with maximum semantics or guaranteed delivery, if not rollback. A message will not be delivered if:

  • Host A sends a message, but Host B is not connected

  • Something (possibly, but not necessarily triggered from Host A) transaction rollback

  • B connects after the transaction rollback

In this case, B will never know that the message even exists if it is not informed with any other medium. If the transaction was canceled, it probably doesn't matter. If B connects and collects the message before the transaction is rolled back, rollback also cancels the message's effects on B.

Please note that A can send a message to the queue with a delivery guarantee at least once. If the transaction is complete, then Host A may assume that the message was delivered by a trusted vehicle. If the transaction is canceled, Host A may assume that any message effects have been canceled.

Web Services

A web service is a remote procedure call or other service (for example, the RESTFul API ) published (usually) by an HTTP server. This is a synchronous request / response protocol and does not have a delivery guarantee built into the protocol. The client must verify the correctness of the service. Usually this will be through a response to the request or call waiting time.

In the latter case, web services do not guarantee semantics at most once. The server may end the service and not give an answer (perhaps something goes wrong outside the server). The application should be able to cope with this situation.

IIRC, RESTFul services must be idempotent (the same state is achieved after any number of calls to the same service) , which is a strategy to address this drawback of guaranteed success / failure notification in the web service architecture. The idea is that, conceptually, one records the state, and does not call the service, so you can write as many times as you like. This means that the application can ignore the lack of feedback on success, as it can retry publishing until it receives a Success message from the server.

+28
Dec 30 '09 at 13:06
source share

Note that you can use the Windows Communication Foundation (WCF) as an abstraction layer over MSMQ. This gives you the opportunity to work with the service - only with one-way operations.

For more information see http://msdn.microsoft.com/en-us/library/ms789048.aspx

- larsw

+21
Dec 30 '09 at 12:26
source share

In fact, there is no connection between MSMQ and WebService. Using MSMQ for interprocess communication (you can also use sockets, Windows messaging, mapped memory). it is a Windows service that is responsible for maintaining messages until someone cancels them. you can say that it is more reliable than sockets, since messages are stored on the hard drive, but they are slower than other IPC methods.

You can use MSMQ on dotnet with small lines of code, Just Declare your MessageQueue object and call the Receive and Send methods. The message itself can be a normal string or binary data.

+8
Dec 30 '09 at 14:01
source share

As everyone explained, MSMQ is used as a queue for messages. Messages can be a wrapper for actual data, an object, and anything you can serialize and send through a wire. MSMQ has its limitations. MSMQ 1.0 and MSMQ 2.0 had a 4 MB limit. This restriction has been lifted from MSMQ 3.0. Information Oriented Middleware (MOM) is a concept that relies heavily on messaging. The foundation of the Enterprise Service Bus is based on Messaging. All of these new technologies depend on messaging for asynchronous data delivery with reliability.

+2
Dec 30 '09 at 13:19
source share

MSMQ - Microsoft Message Queuing: • MSMQ is a message queue implementation developed by Microsoft. • It is deployed on Windows Server operating systems. • This is a messaging protocol that allows applications running on separate servers / processes to exchange messages in a secure manner. • MSMQ is commonly used in the enterprise to create software. • MSMQ delivers reliable delivery by placing messages that do not reach their intended destination in the queue and then resending them when they reach the destination. • MSMQ also supports transactions. It allows multiple operations in several queues, and all operations are completed in one transaction, ensuring that either all or none of the operations takes effect. Message Queuing (MSQQ) technology allows applications running at different times to communicate on heterogeneous networks and systems that may be temporarily disabled. The following ports are used for Microsoft Message Queuing operations: • TCP: 1801 • RPC: 135, 2101 *, 2103 *, 2105 * • UDP: 3527, 1801

+1
Feb 12 '16 at 7:09
source share

MSMQ stands for Microsoft Messaging Queue.

This is just a queue that stores a message in a formatted form so that it can go to the database (maybe on the same computer or on the server). There is a different type of queue that classifies a message between itself. If there is some problem / error inside the message or an incorrect message is transmitted, it automatically goes into the Dead queue, which means that this is not a process. But before sending the message to the dead queue, it will repeat the maximum number and until it is a process, then it can send it to the Dead queue. It is usually used to send a log message from the client machine to the server or database, so that if there is any problem on the client machine, the developer or support team can go through the log to solve the problem. MSMQ is a service provided by Microsoft to obtain a log file record and an easily accessible solution using a log file. You get the best idea from this blog http://msdn.microsoft.com/en-us/library/ms711472(v=vs.85).aspx

0
Jul 21 '14 at 11:00 a.m.
source share



All Articles