首先弄清楚几个定义
Synchronous: both parties must be alive when the communication occurs
Asynchronous: the parties do not need to wait for communication to occur
Drawback of synchronous communications:
Ø Does not tolerate component or network failure
Ø Difficult to adapt to network configuration and business model
Message Queuing
Ø Message Queuing is a technique for sending messages from one program to another by providing an intermediate storage point in computer memory or in a disk file.
Ø Messages are stored in message queues until they can be read by the receiver program.
Advantage of MQ
Ø Program can execute independently
Ø They do not need to know each other’s location
Ø Do not need to wait for the receiver to process before continuing
Message
Ø A unit of data sent between two computers
Ø Can be very simple string text or more complex embedded objects
Ø Communication through messaging requires both programs to agree upon the type of data in the message
How MQ works
1. makes a call to the MQ system – the message is ready to send to Program B
2. MQ system sends the message to the Program B
3. At the appropriate time, Program B reads the message from its queue and process the information
4. if system communication failure, receiver abort or crash, message recovery capabilities enable the message to be re-sent without further application intervention.
Two main categories
Ø Public queues
v Can be accessed by all of the sites connected by the network
Ø Private queues
v Are not published across the entire network
v Only available on the local computer
Ø Administration queues
v Contain messages acknowledging the receipt of the messages sent within a given MQ network
Ø Response queues
v Contain response messages when the message is received by the destination application.
Features of MSMQ
Ø Robustness
Ø Message prioritization
o More important messages can be received before less important messages
Ø Offline capabilities
o Messages can be sent to temporary queues and remains until they are successfully delivered.
o The message delivery is guaranteed when the network connection is restored.
Ø Transactional Messaging
o You can couple several related messages into a single transaction, and delivered only once.