message oriented communication

25
Message-Oriented Communication Presented by: Ms. Punam S. Pawar

Upload: punam-pawar-salunkhe

Post on 07-Apr-2015

1.826 views

Category:

Documents


20 download

TRANSCRIPT

Page 1: Message Oriented Communication

Message-Oriented Communication

Presented by: Ms. Punam S. Pawar

Page 2: Message Oriented Communication

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

Page 3: Message Oriented Communication

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

Page 4: Message Oriented Communication

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

Page 5: Message Oriented Communication

Example - Persistent communication of letters

Page 6: Message Oriented Communication

Forms of communication

a) Persistent asynchronous communication (e.g., email)b) Persistent synchronous communication

Page 7: Message Oriented Communication

Forms of communication

c) Transient asynchronous communication (e.g., UDP)d) Receipt-based transient synchronous communication

Page 8: Message Oriented Communication

Forms of communication

e) Delivery-based transient synchronous communication at message delivery(e.g., asynchronous RCP)f) Response-based transient synchronous communication (RPC)

Page 9: Message Oriented Communication

Message - oriented communication

• Examples• Message-oriented transient communication

- Berkeley Sockets- Message Passing Interface (MPI)

• Message-oriented persistent communication- Message Queuing Model

Page 10: Message Oriented Communication

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

Page 11: Message Oriented Communication

Berkeley Socket Primitives

Page 12: Message Oriented Communication

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

Page 13: Message Oriented Communication

MPI Primitives• A (groupID, processID) pair therefore uniquely identifies the source or

destination of a message,

Page 14: Message Oriented Communication

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”

Page 15: Message Oriented Communication

Message Queuing Model• Four combinations for loosely-coupled communications using

queues.

Page 16: Message Oriented Communication

• 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.

Page 17: Message Oriented Communication

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”.

Page 18: Message Oriented Communication

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

Page 19: Message Oriented Communication

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

Page 20: Message Oriented Communication

• 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

Page 21: Message Oriented Communication

Example: IBM MQSeries

Page 22: Message Oriented Communication

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

Page 23: Message Oriented Communication

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.

Page 24: Message Oriented Communication

Message Transfer (1)

• The general organization of an MQSeries queuing network using routing tables and aliases.

Page 25: Message Oriented Communication

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