message oriented communication
TRANSCRIPT
Message-Oriented Communication
Presented by: Ms. Punam S. Pawar
Why messaging?
• RPC and RMI - hide communication, access transparency, synchronous
• client asks a service and waits until it gets a reply• server waits for requests, performs it and
returns to waiting• requires that the other party is up• In large distributed systems, all parties are not
constantly running- Messaging is the way
Synchronous vs. asynchronous communication
• synchronous communicationthe sender is blocked until the message is stored in a local buffer at the receiving host or is delivered to the receiver
• asynchronous communicationthe sender continues after it has submitted the message for transmission
Persistent vs. transient communication
• persistent communicationa message is stored by the communication system as long as it takes to deliver it – never lost or thrown away
• transient communication - a message is stored by the communication system only as long
as the sending and receiving application are executing-Discard message if it can’t be delivered to next server/receiver-Example: transport-level communication services offer
transient communication - Example: Typical network router – discard message if it can’t be delivered next router or destination
Example - Persistent communication of letters
Forms of communication
a) Persistent asynchronous communication (e.g., email)b) Persistent synchronous communication
Forms of communication
c) Transient asynchronous communication (e.g., UDP)d) Receipt-based transient synchronous communication
Forms of communication
e) Delivery-based transient synchronous communication at message delivery(e.g., asynchronous RCP)f) Response-based transient synchronous communication (RPC)
Message - oriented communication
• Examples• Message-oriented transient communication
- Berkeley Sockets- Message Passing Interface (MPI)
• Message-oriented persistent communication- Message Queuing Model
Message-oriented TransientCommunication
• Many distributed systems and applications are built directly on top of the simple message-oriented model offered by the transport layer.
Berkeley Socket• Socket: It is a communication end point.
Fig. Connection-oriented communication pattern using sockets
Berkeley Socket Primitives
Message-Passing Interface (MPI)• Disadvantages of Socket:
– at the wrong level of abstraction by support only simple send and receive primitives.
– designed to communicate across networks using general-purpose protocol stacks(TCP/IP).
– not considered suitable for the proprietary protocols developed for high-speed interconnection networks, such as those used in high-performance server clusters.
• Those protocols required an interface.– For high-performance multicomputer.– to easily write highly efficient applications.– implementation incurs only minimal overhead.– hardware and platform independent– designed for parallel applications– communication takes place within group of processes.– higher level interface for transient async & sync communication
MPI Primitives• A (groupID, processID) pair therefore uniquely identifies the source or
destination of a message,
Message - oriented persistent communication
• Message Queuing Systems– Message Oriented Middleware – MOM– Support asynchronous persistent communication– basic idea: applications communicate by inserting
messages in specific queues.– messages are forwarded over a series of communication
servers– provides queues to sender and receiver– senders and receivers do not need to be active at the
same time– guarantee for delivering, no guarantee for the delivering
moment– “Loosely coupled communication”
Message Queuing Model• Four combinations for loosely-coupled communications using
queues.
• Basic interface to a queue in a message-queuing system
• General architecture of a message-queuing system– Queues are managed by queue managers.– Static mapping is easier, dynamic mapping is more complex.
Message-Queuing System Architecture
• Messages are “put into” a source queue.• They are then “taken from” a destination queue.• Obviously, a mechanism has to exist to move a
message from a source queue to a destination queue.
• This is the role of the Queue Manager.• These are message-queuing “relays” that interact
with the distributed applications and with each other. Not unlike routers, these devices support the notion of a DS “overlay network”.
Message-Queuing System with routers• Routers know about network, queue manager know the nearest
router• Only routers need to be updated when queues are added or
removed
Message Brokers• converts a message to the format of the destination application• contains a database of conversion rules
• use of a message broker for advanced enterprise application integration (EAI)• publish/subscribe model – instead of converting message
• General-purpose MQ systems support a wide range of applications, including:– Electronic mail.– Workflow.– Groupware.– Batch Processing.
• Most important MQ application area:– The integration of a widely dispersed collection of
database applications (which is all but impossible to do with traditional RPC/RMI techniques).
Message-Queuing (MQ) Applications
Example: IBM MQSeries
Overview• All queues are managed by queue managers.• Function of queue manager.• QM are pair wise connected through message
channel.• MCs are reliable, unidirectional connection.• MCA-Message Channel Agent manage 2 ends of
MCs.• Sending MCA-checking, wrapping, sending msg.• Receiving MCA- listen, unwrapping, store in
queue
Channels
Attribute Description
Transport type Determines the transport protocol to be used
FIFO deliveryIndicates that messages are to be delivered in the order they are sent
Message length
Maximum length of a single message
Setup retry count
Specifies maximum number of retries to start up the remote MCA
Delivery retries
Maximum times MCA will try to put received message into queue
• exactly one send queue• for transmission both MCA are running.• Alternatives to start MCA :
• application start appropriate MCA but not transparent• Trigger• If one MCA active send control msg to other over network.
Message Transfer (1)
• The general organization of an MQSeries queuing network using routing tables and aliases.
Message Transfer (2)
Primitives available in an IBM MQSeries MQI
Primitive Description
MQopen Open a (possibly remote) queue
MQclose Close a queue
MQput Put a message into an opened queue
MQget Get a message from a (local) queue