20
Programação de Sistemas Distribuidos Paulo Gandra de Sousa [email protected] Mestrado em Engenharia Informática DEI/ISEP

Decoupled Communication

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Decoupled Communication

Programação de

Sistemas

Distribuidos

Paulo Gandra de Sousa

[email protected]

Mestrado em Engenharia Informática

DEI/ISEP

Page 2: Decoupled Communication

Disclaimer

Parts of this presentation are from:

Tannembaum

1

ISEP/IPP

Page 3: Decoupled Communication

Today’s lesson

Decoupled communication

Message queueing

Enterprise Service Bus

2

ISEP/IPP

Page 4: Decoupled Communication

DECOUPLED

COMMUNICATION

3

ISEP/IPP

Page 5: Decoupled Communication

Decoupled communication

What if the receiver is not avaliable?

We need something

Assynchronous and persistent

E.g., voice mail

4

ISEP/IPP

Page 6: Decoupled Communication

Persistence and Synchronicity in

Communication (1)

Persistent communication of letters back in the days

of the Pony Express.

Page 7: Decoupled Communication

Persistence and Synchronicity in

Communication (2)

a) Persistent asynchronous communication

b) Persistent synchronous communication

2-22.1

Page 8: Decoupled Communication

Reliability

Guaranteed delivery in the presence ofnetwork or (receiver) application failures

TCP reliabilibity vs. Reliable Messaging

TCP guarantees that the message iscorrectly delivered if the receiving endpoint is“alive”

Message Queues guarantee delivery even ifthe receiving end is not available withoutextra programming effort

7

ISEP/IPP

Page 9: Decoupled Communication

General Architecture of a Message-

Queuing System (1)

The relationship between queue-level addressing

and network-level addressing.

Page 10: Decoupled Communication

General Architecture of a Message-

Queuing System (2)

The general organization of a message-queuing

system with routers.

2-29

Page 11: Decoupled Communication

Message-Queuing Model

(1)

Four combinations for loosely-coupled communications using

queues.

2-26

Page 12: Decoupled Communication

Message-Queuing Model

(2)

Basic interface to a queue in a message-queuing

system.

Primitive Meaning

Put Append a message to a specified queue

GetBlock until the specified queue is nonempty, and remove the first message

PollCheck a specified queue for messages, and remove the first. Never block.

NotifyInstall a handler to be called when a message is put into the specified queue.

Page 13: Decoupled Communication

Decouple even more

Message broker

Delivers, and

Translates message formats

14

ISEP/IPP

Page 14: Decoupled Communication

Message Brokers

The general organization of a message broker in a message-

queuing system.

2-30

Page 15: Decoupled Communication

Enterprise Service Bus

(ESB)

Decouple senders and receivers

Promotes construction of applications

from basic functionality blocks

A way to decouple message format from

publishers and subscribers

Can encode business logic in the bus

itself (ex., process choreography)

20

ISEP/IPP

Page 17: Decoupled Communication

ESB

22

ISEP/IPP

http://www.vitria.com/Business_Accelerator/esb.php

Page 18: Decoupled Communication

ESB sample app: Loan

Broker

23

ISEP/IPPhttp://mule.mulesource.org/display/MULE/LoanBroker+ESB

Page 19: Decoupled Communication

Exercise

Remember the example DS you provided in the last session.

Would it be natural to use reliable messaging?

Would it be natural to use a decoupled architecture?

What about an ESB?

24

ISEP/IPP

Page 20: Decoupled Communication

Bibliography

Chapter 2 Tanenbaum

http://en.wikipedia.org/wiki/Loose_coupling

http://en.wikipedia.org/wiki/Message_queue

25

ISEP/IPP