SlideShare una empresa de Scribd logo
1 de 30
Introduction to Middleware I
•

What is Middleware?
– Layer between OS and distributed applications
– Hides complexity and heterogeneity of distributed system
– Bridges gap between low-level OS communications and programming
language abstractions
– Provides common programming abstraction and infrastructure for
distributed applications
– Overview at: http://www.middleware.org

Distributed Applications
Distributed Applications
Distributed Applications

Middleware
Operating System Comms
Operating System Comms
Operating System Comms
Network
Network
Network
Middleware

(remote calls, object invocation,
messages, …)
(sockets, IP, TCP, UDP, …)
(packets, bits…)

1
Introduction to Middleware II
• Middleware provides support for (some of):
–
–
–
–

Naming, Location, Service discovery, Replication
Protocol handling, Communication faults, QoS
Synchronisation, Concurrency, Transactions, Storage
Access control, Authentication

• Middleware dimensions:
–
–
–
–
–

Middleware

Request/Reply
Language-specific
Proprietary
Small-scale
Tightly-coupled

vs.
vs.
vs.
vs.
vs.

Asynchronous Messaging
Language-independent
Standards-based
Large-scale
Loosely-coupled components

2
Outline
• Part I: Remote Procedure Call (RPC)
– Historic interest

• Part II: Object-Oriented Middleware (OOM)
– Java RMI
– CORBA
– Reflective Middleware

• Part III:

h
arc
e
es Middleware
r
Message-Oriented

(MOM)

– Java Message Service
– IBM MQSeries
– Web Services

• Part IV: Event-Based Middleware
– Cambridge Event Architecture
h
arc
e
– Hermes
es
r
Middleware

3
Part I: Remote Procedure Call (RPC)
• Masks remote function calls as being local
• Client/server model
• Request/reply paradigm usually implemented with
message passing in RPC service
• Marshalling of function parameters and return value
Caller

call(…)

RPC Service
1) Marshal args
2) Generate ID
3) Start timer
8) Unmarshal
9) Acknowledge

Middleware

RPC Service
message

4) Unmarshal
5) Record ID

Remote
Functio
n
fun(…)

6) Marshal
7) Set timer

4
Properties of RPC
Language-level pattern of function call
•

easy to understand for programmer

Synchronous request/reply interaction
•
•
•

natural from a programming language point-of-view
matches replies to requests
built in synchronisation of requests and replies

Distribution transparency (in the no-failure case)
•

hides the complexity of a distributed system

Various reliability guarantees
•
Middleware

deals with some distributed systems aspects of failure
5
Failure Modes of RPC
•

•

Invocation semantics supported by RPC in the light of:
network and/or server congestion,
client, network and/or server failure
note DS independent failure modes
RPC systems differ, many examples, local was Mayflower

Maybe or at most once (RPC system tries
once)
• Error return – programmer may retry
Exactly once (RPC system retries a few times)
• Hard error return – some failure most likely
note that “exactly once” cannot be guaranteed
Middleware

6
Disadvantages of RPC
 Synchronous request/reply interaction
• tight coupling between client and server
• client may block for a long time if server loaded
leads to multi-threaded programming at client
fork(…)
• slow/failed clients may delay servers when replying
multi-threading essential at servers

remote call

 Distribution Transparency
• Not possible to mask all problems

join(…)

 RPC paradigm is not object-oriented
• invoke functions on servers as opposed to methods on objects

Middleware

7
Part II: Object-Oriented Middleware (OOM)
•
•
•
•
•

Objects can be local or remote
Object references can be local or remote
Remote objects have visible remote interfaces
Masks remote objects as being local using proxy objects
Remote method invocation
local
object A

proxy
object B
Middleware

OOM
object
request
broker
/
object
manager

OOM
object
request
broker
/
object
manager

remote
skeleton
object B

object B

8
Properties of OOM
Support for object-oriented programming model
– objects, methods, interfaces, encapsulation, …
– exceptions (were also in some RPC systems e.g. Mayflower)

Synchronous request/reply interaction
– same as RPC

Location Transparency
– system (ORB) maps object references to locations

Services comprising multiple servers are easier to build with OOM
– RPC programming is in terms of server-interface (operation)
– RPC system looks up server address in a location service
Middleware

9
Java Remote Method Invocation (RMI)
• Covered in 1B Advanced Java programming
• Distributed objects in Java
public interface PrintService extends Remote {
int print(Vector printJob) throws RemoteException;
}

• RMI compiler creates proxies and skeletons
• RMI registry used for interface lookup
• Entire system written in Java (single-language system)

Middleware

10
CORBA
• Common Object Request Broker Architecture
– Open standard by the OMG (Version 3.0)
– Language- and platform independent

• Object Request Broker (ORB)
– General Inter-ORB Protocol (GIOP) for communication
– Interoperable Object References (IOR) contain object location
– CORBA Interface Definition Language (IDL)
• Stubs (proxies) and skeletons created by IDL compiler
– Dynamic remote method invocation

• Interface Repository
– Querying existing remote interfaces

• Implementation Repository
– Activating remote objects on demand
Middleware

11
CORBA IDL
• Definition of language-independent remote interfaces
– Language mappings to C++, Java, Smalltalk, …
– Translation by IDL compiler

• Type system
typedef sequence<string> Files;
– basic types: long (32 bit),
interface PrintService : Server {
long long (64 bit), short,
void print(in Files printJob);
float, char, boolean,
};
octet, any, …
– constructed types: struct, union, sequence, array, enum
– objects (common super type Object)

• Parameter passing
– in, out, inout
– basic & constructed types passed by value
– objects passed by reference
Middleware

12
CORBA Services (selection)
• Naming Service
– Names  remote object references

• Trading Service
– Attributes (properties)  remote object references

• Persistent Object Service
– Implementation of persistent CORBA objects

• Transaction Service
– Making object invocation part of transactions

• Event Service and Notification Service
– In response to applications‘ need for asynchronous communication
– built above synchronous communication with push or pull options
– not an integrated programming model with general IDL messages

Middleware

13
Disadvantages of OOM
 Synchronous request/reply interaction only
• So CORBA oneway semantics added and • Asynchronous Method Invocation (AMI)
• But implementations may not be loosely coupled

 Distributed garbage collection
• Releasing memory for unused remote objects

 OOM rather static and heavy-weight
• Bad for ubiquitous systems and embedded devices

Middleware

14
OOM experience
Keynote address at Middleware 2009
Steve Vinoski
From Middleware Implementor to Middleware User
(There and back again)

Available from the course materials page and the MW09
program on the website
Middleware

15
Reflective Middleware
• Flexible middleware (OOM) for mobile and context-aware
applications – adaptation to context through monitoring
and substitution of components
• Interfaces for reflection
– Objects can inspect middleware behaviour

• Interfaces for customisability
– Dynamic reconfiguration depending on environment
– Different protocols, QoS, ...
– e.g. use different marshalling strategy over unreliable wireless link

Middleware

16
Part III: Message-Oriented Middleware (MOM)
•
•
•
•

Communication using messages
Messages stored in message queues
message servers decouple client and server
Various assumptions about message content
Client App.

Server App.
Message
Servers

local message
queues

local message
queues

Network

Middleware

message
queues

Network

Network
17
Properties of MOM
Asynchronous interaction
–
–
–

Client and server are only loosely coupled
Messages are queued
Good for application integration

Support for reliable delivery service
–

Keep queues in persistent storage

Processing of messages by intermediate message server(s)
–
–

May do filtering, transforming, logging, …
Networks of message servers

Natural for database integration

Middleware

18
IBM MQSeries
• One-to-one reliable message passing using queues
– Persistent and non-persistent messages
– Message priorities, message notification

• Queue Managers
– Responsible for queues
– Transfer messages from input to output queues
– Keep routing tables

• Message Channels
– Reliable connections between queue managers

• Messaging API:

MQopen Open a queue
MQclose Close a queue
MQput
MQget

Middleware

Put message into opened queue
Get message from local queue
19
Java Message Service (JMS)
• API specification to access MOM implementations
• Two modes of operation *specified*:
– Point-to-point
• one-to-one communication using queues
– Publish/Subscribe
• cf. Event-Based Middleware

•
•
•
•
•
Middleware

JMS Server implements JMS API
JMS Clients connect to JMS servers
Java objects can be serialised to JMS messages
A JMS interface has been provided for MQ
pub/sub (one-to-many) - just a specification?
20
Disadvantages of MOM
 Poor programming abstraction (but has evolved)
• Rather low-level (cf. Packets)
• Request/reply more difficult to achieve, but can be done

 Message formats originally unknown to middleware
• No type checking (JMS addresses this – implementation?)

 Queue abstraction only gives one-to-one communication
• Limits scalability (JMS pub/sub – implementation?)

Middleware

21
Web Services
• Use well-known web standards for distributed computing
Communication
• Message content expressed in XML
• Simple Object Access Protocol (SOAP)
– Lightweight protocol for sync/async communication

Service Description
• Web Services Description Language (WSDL)
– Interface description for web services

Service Discovery
• Universal Description Discovery and Integration (UDDI)
– Directory with web service description in WSDL
Middleware

22
Properties of Web Services
Language-independent and open standard
SOAP offers OOM and MOM-style communication:
•
•
•
•

Synchronous request/reply like OOM
Asynchronous messaging like MOM
Supports internet transports (http, smtp, ...)
Uses XML Schema for marshalling types to/from programming
language types

WSDL says how to use a web service

http://api.google.com/GoogleSearch.wsdl

UDDI helps to find the right web service
• Exports SOAP API for access
Middleware

23
Disadvantages of Web Services
 Low-level abstraction
• leaves a lot to be implemented

 Interaction patterns have to be built
•
•
•
•

one-to-one and request-reply provided
one-to-many?
still synchronous service invocation, rather than notification
No nested/grouped invocations, transactions, ...

 No location transparency

Middleware

24
What we lack, so far
 General interaction patterns
•
•
•
•

we have one-to-one and request-reply
one-to-many? many to many?
notification?
dynamic joining and leaving?

 Location transparency
• anonymity of communicating entities

 Support for pervasive computing
• data values from sensors
• lightweight software

Middleware

25
Part IV: Event-Based Middleware a.k.a. Publish/Subscribe
•
•
•
•

Publishers (advertise and) publish events (messages)
Subscribers express interest in events with subscriptions
Event Service notifies interested subscribers of published events
Events can have arbitrary content (typed) or name/value pairs

Publisher

Publisher publish
Publisher publish

Middleware

subscribe

publish

Event Service

notify

(event-brokersubscribe
network)

notify
subscribe
notify

Subscribe
r
Subscribe
r
Subscribe
r
26
Topic-Based and Content-Based Pub/Sub
• Event Service matches events against subscriptions
• What do subscriptions look like?
Topic-Based Publish/Subscribe
– Publishers publish events belonging to a topic or subject
– Subscribers subscribe to a topic
subscribe(PrintJobFinishedTopic, …)

(Topic and) Content-Based Publish/Subscribe
– Publishers publish events belonging to topics and
– Subscribers provide a filter based on content of events
subscribe(type=printjobfinished, printer=‘aspen’, …)

Middleware

27
Properties of Publish/Subscribe
Asynchronous communication
• Publishers and subscribers are loosely coupled

Many-to-many interaction between pubs. and subs.
• Scalable scheme for large-scale systems
• Publishers do not need to know subscribers, and vice-versa
• Dynamic join and leave of pubs, subs, (brokers - see lecture DS-8)

(Topic and) Content-based pub/sub very expressive
• Filtered information delivered only to interested parties
• Efficient content-based routing through a broker network

Middleware

28
Composite Event Detection (CED)
• Content-based pub/sub may not be expressive enough
– Potentially thousands of event types (primitive events)
– Subscribers interest: event patterns (define high-level events, ref DS-2)

• Event Patterns
PrinterOutOfPaperEvent or PrinterOutOfTonerEvent

• Composite Event Detectors (CED)
– Subscribe to primitive events and publish composite events
Publisher
Publisher

CED
CED

Publisher
Publisher
Middleware

Subscribe
r

CED

Subscribe
r
29
Summary
• Middleware is an important abstraction for building
distributed systems
1.
2.
3.
4.
•
•
•
•
Middleware

Remote Procedure Call
Object-Oriented Middleware
Message-Oriented Middleware
Event-Based Middleware

Synchronous vs. asynchronous communication
Scalability, many-to-many communication
Language integration
Ubiquitous systems, mobile systems
30

Más contenido relacionado

La actualidad más candente

Distributed Systems
Distributed SystemsDistributed Systems
Distributed SystemsRupsee
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
Unit 3 cs6601 Distributed Systems
Unit 3 cs6601 Distributed SystemsUnit 3 cs6601 Distributed Systems
Unit 3 cs6601 Distributed SystemsNandakumar P
 
Virus and its CounterMeasures -- Pruthvi Monarch
Virus and its CounterMeasures                         -- Pruthvi Monarch Virus and its CounterMeasures                         -- Pruthvi Monarch
Virus and its CounterMeasures -- Pruthvi Monarch Pruthvi Monarch
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecturenupurmakhija1211
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
CS8791 Unit 2 Cloud Enabling Technologies
CS8791 Unit 2 Cloud Enabling TechnologiesCS8791 Unit 2 Cloud Enabling Technologies
CS8791 Unit 2 Cloud Enabling Technologieskarthikajegadeesan
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
 
Foult Tolerence In Distributed System
Foult Tolerence In Distributed SystemFoult Tolerence In Distributed System
Foult Tolerence In Distributed SystemRajan Kumar
 
Distributed computing
Distributed computingDistributed computing
Distributed computingKeshab Nath
 
Communications is distributed systems
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systemsSHATHAN
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 

La actualidad más candente (20)

Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Unit 3 cs6601 Distributed Systems
Unit 3 cs6601 Distributed SystemsUnit 3 cs6601 Distributed Systems
Unit 3 cs6601 Distributed Systems
 
Distributed Coordination-Based Systems
Distributed Coordination-Based SystemsDistributed Coordination-Based Systems
Distributed Coordination-Based Systems
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Virus and its CounterMeasures -- Pruthvi Monarch
Virus and its CounterMeasures                         -- Pruthvi Monarch Virus and its CounterMeasures                         -- Pruthvi Monarch
Virus and its CounterMeasures -- Pruthvi Monarch
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecture
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
CS8791 Unit 2 Cloud Enabling Technologies
CS8791 Unit 2 Cloud Enabling TechnologiesCS8791 Unit 2 Cloud Enabling Technologies
CS8791 Unit 2 Cloud Enabling Technologies
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
Foult Tolerence In Distributed System
Foult Tolerence In Distributed SystemFoult Tolerence In Distributed System
Foult Tolerence In Distributed System
 
Distributed System ppt
Distributed System pptDistributed System ppt
Distributed System ppt
 
Unit 1
Unit 1Unit 1
Unit 1
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
Common Standards in Cloud Computing
Common Standards in Cloud ComputingCommon Standards in Cloud Computing
Common Standards in Cloud Computing
 
Communications is distributed systems
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systems
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 

Destacado

Middleware Basics
Middleware BasicsMiddleware Basics
Middleware BasicsVarun Arora
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middlewaresanjoysanyal
 
Communication middleware
Communication middlewareCommunication middleware
Communication middlewarePeter R. Egli
 
Network Mnagement for WSN
Network Mnagement for WSNNetwork Mnagement for WSN
Network Mnagement for WSN@zenafaris91
 
Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor NetworksKarthik
 
Object and component based middleware for distributed system development
Object and component based middleware for distributed system developmentObject and component based middleware for distributed system development
Object and component based middleware for distributed system developmentektabhalwara
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application IntegrationComputing Cage
 
Topic3 Enterprise Application Integration
Topic3 Enterprise Application IntegrationTopic3 Enterprise Application Integration
Topic3 Enterprise Application Integrationsanjoysanyal
 
A Presentation On Enterprise Application Integration
A Presentation On Enterprise Application IntegrationA Presentation On Enterprise Application Integration
A Presentation On Enterprise Application IntegrationUmesh Upadhyaya
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application IntegrationTomas Dermisek
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web ServerGagandeep Singh
 
Enterprise application integration
Enterprise application integrationEnterprise application integration
Enterprise application integrationGoa App
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration TechnologiesPeter R. Egli
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented MiddlewarePeter R. Egli
 

Destacado (20)

Middleware Basics
Middleware BasicsMiddleware Basics
Middleware Basics
 
Middleware
MiddlewareMiddleware
Middleware
 
Middleware
MiddlewareMiddleware
Middleware
 
middleware
middlewaremiddleware
middleware
 
Topic2 Understanding Middleware
Topic2 Understanding MiddlewareTopic2 Understanding Middleware
Topic2 Understanding Middleware
 
Middleware
MiddlewareMiddleware
Middleware
 
Communication middleware
Communication middlewareCommunication middleware
Communication middleware
 
Network Mnagement for WSN
Network Mnagement for WSNNetwork Mnagement for WSN
Network Mnagement for WSN
 
Wireless Sensor Networks
Wireless Sensor NetworksWireless Sensor Networks
Wireless Sensor Networks
 
Middleware
MiddlewareMiddleware
Middleware
 
Object and component based middleware for distributed system development
Object and component based middleware for distributed system developmentObject and component based middleware for distributed system development
Object and component based middleware for distributed system development
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application Integration
 
Topic3 Enterprise Application Integration
Topic3 Enterprise Application IntegrationTopic3 Enterprise Application Integration
Topic3 Enterprise Application Integration
 
A Presentation On Enterprise Application Integration
A Presentation On Enterprise Application IntegrationA Presentation On Enterprise Application Integration
A Presentation On Enterprise Application Integration
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application Integration
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
 
Enterprise application integration
Enterprise application integrationEnterprise application integration
Enterprise application integration
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
 
7 eai-patterns
7 eai-patterns7 eai-patterns
7 eai-patterns
 

Similar a Middleware

middleware
middlewaremiddleware
middlewarerkk0o7
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and modelsMayank Jain
 
remote method invocation
remote method invocationremote method invocation
remote method invocationRavi Theja
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed SystemsDilum Bandara
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYreginamutio48
 
Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Benjamin Cabé
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
CORBA Basic and Deployment of CORBA
CORBA Basic and Deployment of CORBACORBA Basic and Deployment of CORBA
CORBA Basic and Deployment of CORBAPriyanka Patil
 
Chapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptxChapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptxmeharikiros2
 
DS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdfDS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdfVarshaBaini
 
Java RMI Detailed Tutorial
Java RMI Detailed TutorialJava RMI Detailed Tutorial
Java RMI Detailed TutorialMasud Rahman
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introductionRandy Abernethy
 
Soap Standard
Soap StandardSoap Standard
Soap StandardKumar
 
Manish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareManish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareA P
 

Similar a Middleware (20)

12-middleware.ppt
12-middleware.ppt12-middleware.ppt
12-middleware.ppt
 
middleware
middlewaremiddleware
middleware
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and models
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Mq Lecture
Mq LectureMq Lecture
Mq Lecture
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
 
4. system models
4. system models4. system models
4. system models
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
 
Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
CORBA Basic and Deployment of CORBA
CORBA Basic and Deployment of CORBACORBA Basic and Deployment of CORBA
CORBA Basic and Deployment of CORBA
 
Chapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptxChapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptx
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
Ead pertemuan-7
Ead pertemuan-7Ead pertemuan-7
Ead pertemuan-7
 
DS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdfDS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdf
 
Java RMI Detailed Tutorial
Java RMI Detailed TutorialJava RMI Detailed Tutorial
Java RMI Detailed Tutorial
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 
Soap Standard
Soap StandardSoap Standard
Soap Standard
 
Manish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareManish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middleware
 

Más de Dr. Uday Saikia

LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech RecognitionDr. Uday Saikia
 
POLYNOMIALS,CURVEFITTING, AND INTERPOLATION
POLYNOMIALS,CURVEFITTING, AND INTERPOLATIONPOLYNOMIALS,CURVEFITTING, AND INTERPOLATION
POLYNOMIALS,CURVEFITTING, AND INTERPOLATIONDr. Uday Saikia
 
Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)Dr. Uday Saikia
 
Intelligence and artificial intelligence
Intelligence and artificial intelligenceIntelligence and artificial intelligence
Intelligence and artificial intelligenceDr. Uday Saikia
 
Artificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character RecognitionArtificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character RecognitionDr. Uday Saikia
 

Más de Dr. Uday Saikia (6)

LPC for Speech Recognition
LPC for Speech RecognitionLPC for Speech Recognition
LPC for Speech Recognition
 
POLYNOMIALS,CURVEFITTING, AND INTERPOLATION
POLYNOMIALS,CURVEFITTING, AND INTERPOLATIONPOLYNOMIALS,CURVEFITTING, AND INTERPOLATION
POLYNOMIALS,CURVEFITTING, AND INTERPOLATION
 
Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)Brain Computer Interfaces(BCI)
Brain Computer Interfaces(BCI)
 
Intelligence and artificial intelligence
Intelligence and artificial intelligenceIntelligence and artificial intelligence
Intelligence and artificial intelligence
 
Quality management
Quality managementQuality management
Quality management
 
Artificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character RecognitionArtificial Neural Network / Hand written character Recognition
Artificial Neural Network / Hand written character Recognition
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Middleware

  • 1. Introduction to Middleware I • What is Middleware? – Layer between OS and distributed applications – Hides complexity and heterogeneity of distributed system – Bridges gap between low-level OS communications and programming language abstractions – Provides common programming abstraction and infrastructure for distributed applications – Overview at: http://www.middleware.org Distributed Applications Distributed Applications Distributed Applications Middleware Operating System Comms Operating System Comms Operating System Comms Network Network Network Middleware (remote calls, object invocation, messages, …) (sockets, IP, TCP, UDP, …) (packets, bits…) 1
  • 2. Introduction to Middleware II • Middleware provides support for (some of): – – – – Naming, Location, Service discovery, Replication Protocol handling, Communication faults, QoS Synchronisation, Concurrency, Transactions, Storage Access control, Authentication • Middleware dimensions: – – – – – Middleware Request/Reply Language-specific Proprietary Small-scale Tightly-coupled vs. vs. vs. vs. vs. Asynchronous Messaging Language-independent Standards-based Large-scale Loosely-coupled components 2
  • 3. Outline • Part I: Remote Procedure Call (RPC) – Historic interest • Part II: Object-Oriented Middleware (OOM) – Java RMI – CORBA – Reflective Middleware • Part III: h arc e es Middleware r Message-Oriented (MOM) – Java Message Service – IBM MQSeries – Web Services • Part IV: Event-Based Middleware – Cambridge Event Architecture h arc e – Hermes es r Middleware 3
  • 4. Part I: Remote Procedure Call (RPC) • Masks remote function calls as being local • Client/server model • Request/reply paradigm usually implemented with message passing in RPC service • Marshalling of function parameters and return value Caller call(…) RPC Service 1) Marshal args 2) Generate ID 3) Start timer 8) Unmarshal 9) Acknowledge Middleware RPC Service message 4) Unmarshal 5) Record ID Remote Functio n fun(…) 6) Marshal 7) Set timer 4
  • 5. Properties of RPC Language-level pattern of function call • easy to understand for programmer Synchronous request/reply interaction • • • natural from a programming language point-of-view matches replies to requests built in synchronisation of requests and replies Distribution transparency (in the no-failure case) • hides the complexity of a distributed system Various reliability guarantees • Middleware deals with some distributed systems aspects of failure 5
  • 6. Failure Modes of RPC • • Invocation semantics supported by RPC in the light of: network and/or server congestion, client, network and/or server failure note DS independent failure modes RPC systems differ, many examples, local was Mayflower Maybe or at most once (RPC system tries once) • Error return – programmer may retry Exactly once (RPC system retries a few times) • Hard error return – some failure most likely note that “exactly once” cannot be guaranteed Middleware 6
  • 7. Disadvantages of RPC  Synchronous request/reply interaction • tight coupling between client and server • client may block for a long time if server loaded leads to multi-threaded programming at client fork(…) • slow/failed clients may delay servers when replying multi-threading essential at servers remote call  Distribution Transparency • Not possible to mask all problems join(…)  RPC paradigm is not object-oriented • invoke functions on servers as opposed to methods on objects Middleware 7
  • 8. Part II: Object-Oriented Middleware (OOM) • • • • • Objects can be local or remote Object references can be local or remote Remote objects have visible remote interfaces Masks remote objects as being local using proxy objects Remote method invocation local object A proxy object B Middleware OOM object request broker / object manager OOM object request broker / object manager remote skeleton object B object B 8
  • 9. Properties of OOM Support for object-oriented programming model – objects, methods, interfaces, encapsulation, … – exceptions (were also in some RPC systems e.g. Mayflower) Synchronous request/reply interaction – same as RPC Location Transparency – system (ORB) maps object references to locations Services comprising multiple servers are easier to build with OOM – RPC programming is in terms of server-interface (operation) – RPC system looks up server address in a location service Middleware 9
  • 10. Java Remote Method Invocation (RMI) • Covered in 1B Advanced Java programming • Distributed objects in Java public interface PrintService extends Remote { int print(Vector printJob) throws RemoteException; } • RMI compiler creates proxies and skeletons • RMI registry used for interface lookup • Entire system written in Java (single-language system) Middleware 10
  • 11. CORBA • Common Object Request Broker Architecture – Open standard by the OMG (Version 3.0) – Language- and platform independent • Object Request Broker (ORB) – General Inter-ORB Protocol (GIOP) for communication – Interoperable Object References (IOR) contain object location – CORBA Interface Definition Language (IDL) • Stubs (proxies) and skeletons created by IDL compiler – Dynamic remote method invocation • Interface Repository – Querying existing remote interfaces • Implementation Repository – Activating remote objects on demand Middleware 11
  • 12. CORBA IDL • Definition of language-independent remote interfaces – Language mappings to C++, Java, Smalltalk, … – Translation by IDL compiler • Type system typedef sequence<string> Files; – basic types: long (32 bit), interface PrintService : Server { long long (64 bit), short, void print(in Files printJob); float, char, boolean, }; octet, any, … – constructed types: struct, union, sequence, array, enum – objects (common super type Object) • Parameter passing – in, out, inout – basic & constructed types passed by value – objects passed by reference Middleware 12
  • 13. CORBA Services (selection) • Naming Service – Names  remote object references • Trading Service – Attributes (properties)  remote object references • Persistent Object Service – Implementation of persistent CORBA objects • Transaction Service – Making object invocation part of transactions • Event Service and Notification Service – In response to applications‘ need for asynchronous communication – built above synchronous communication with push or pull options – not an integrated programming model with general IDL messages Middleware 13
  • 14. Disadvantages of OOM  Synchronous request/reply interaction only • So CORBA oneway semantics added and • Asynchronous Method Invocation (AMI) • But implementations may not be loosely coupled  Distributed garbage collection • Releasing memory for unused remote objects  OOM rather static and heavy-weight • Bad for ubiquitous systems and embedded devices Middleware 14
  • 15. OOM experience Keynote address at Middleware 2009 Steve Vinoski From Middleware Implementor to Middleware User (There and back again) Available from the course materials page and the MW09 program on the website Middleware 15
  • 16. Reflective Middleware • Flexible middleware (OOM) for mobile and context-aware applications – adaptation to context through monitoring and substitution of components • Interfaces for reflection – Objects can inspect middleware behaviour • Interfaces for customisability – Dynamic reconfiguration depending on environment – Different protocols, QoS, ... – e.g. use different marshalling strategy over unreliable wireless link Middleware 16
  • 17. Part III: Message-Oriented Middleware (MOM) • • • • Communication using messages Messages stored in message queues message servers decouple client and server Various assumptions about message content Client App. Server App. Message Servers local message queues local message queues Network Middleware message queues Network Network 17
  • 18. Properties of MOM Asynchronous interaction – – – Client and server are only loosely coupled Messages are queued Good for application integration Support for reliable delivery service – Keep queues in persistent storage Processing of messages by intermediate message server(s) – – May do filtering, transforming, logging, … Networks of message servers Natural for database integration Middleware 18
  • 19. IBM MQSeries • One-to-one reliable message passing using queues – Persistent and non-persistent messages – Message priorities, message notification • Queue Managers – Responsible for queues – Transfer messages from input to output queues – Keep routing tables • Message Channels – Reliable connections between queue managers • Messaging API: MQopen Open a queue MQclose Close a queue MQput MQget Middleware Put message into opened queue Get message from local queue 19
  • 20. Java Message Service (JMS) • API specification to access MOM implementations • Two modes of operation *specified*: – Point-to-point • one-to-one communication using queues – Publish/Subscribe • cf. Event-Based Middleware • • • • • Middleware JMS Server implements JMS API JMS Clients connect to JMS servers Java objects can be serialised to JMS messages A JMS interface has been provided for MQ pub/sub (one-to-many) - just a specification? 20
  • 21. Disadvantages of MOM  Poor programming abstraction (but has evolved) • Rather low-level (cf. Packets) • Request/reply more difficult to achieve, but can be done  Message formats originally unknown to middleware • No type checking (JMS addresses this – implementation?)  Queue abstraction only gives one-to-one communication • Limits scalability (JMS pub/sub – implementation?) Middleware 21
  • 22. Web Services • Use well-known web standards for distributed computing Communication • Message content expressed in XML • Simple Object Access Protocol (SOAP) – Lightweight protocol for sync/async communication Service Description • Web Services Description Language (WSDL) – Interface description for web services Service Discovery • Universal Description Discovery and Integration (UDDI) – Directory with web service description in WSDL Middleware 22
  • 23. Properties of Web Services Language-independent and open standard SOAP offers OOM and MOM-style communication: • • • • Synchronous request/reply like OOM Asynchronous messaging like MOM Supports internet transports (http, smtp, ...) Uses XML Schema for marshalling types to/from programming language types WSDL says how to use a web service http://api.google.com/GoogleSearch.wsdl UDDI helps to find the right web service • Exports SOAP API for access Middleware 23
  • 24. Disadvantages of Web Services  Low-level abstraction • leaves a lot to be implemented  Interaction patterns have to be built • • • • one-to-one and request-reply provided one-to-many? still synchronous service invocation, rather than notification No nested/grouped invocations, transactions, ...  No location transparency Middleware 24
  • 25. What we lack, so far  General interaction patterns • • • • we have one-to-one and request-reply one-to-many? many to many? notification? dynamic joining and leaving?  Location transparency • anonymity of communicating entities  Support for pervasive computing • data values from sensors • lightweight software Middleware 25
  • 26. Part IV: Event-Based Middleware a.k.a. Publish/Subscribe • • • • Publishers (advertise and) publish events (messages) Subscribers express interest in events with subscriptions Event Service notifies interested subscribers of published events Events can have arbitrary content (typed) or name/value pairs Publisher Publisher publish Publisher publish Middleware subscribe publish Event Service notify (event-brokersubscribe network) notify subscribe notify Subscribe r Subscribe r Subscribe r 26
  • 27. Topic-Based and Content-Based Pub/Sub • Event Service matches events against subscriptions • What do subscriptions look like? Topic-Based Publish/Subscribe – Publishers publish events belonging to a topic or subject – Subscribers subscribe to a topic subscribe(PrintJobFinishedTopic, …) (Topic and) Content-Based Publish/Subscribe – Publishers publish events belonging to topics and – Subscribers provide a filter based on content of events subscribe(type=printjobfinished, printer=‘aspen’, …) Middleware 27
  • 28. Properties of Publish/Subscribe Asynchronous communication • Publishers and subscribers are loosely coupled Many-to-many interaction between pubs. and subs. • Scalable scheme for large-scale systems • Publishers do not need to know subscribers, and vice-versa • Dynamic join and leave of pubs, subs, (brokers - see lecture DS-8) (Topic and) Content-based pub/sub very expressive • Filtered information delivered only to interested parties • Efficient content-based routing through a broker network Middleware 28
  • 29. Composite Event Detection (CED) • Content-based pub/sub may not be expressive enough – Potentially thousands of event types (primitive events) – Subscribers interest: event patterns (define high-level events, ref DS-2) • Event Patterns PrinterOutOfPaperEvent or PrinterOutOfTonerEvent • Composite Event Detectors (CED) – Subscribe to primitive events and publish composite events Publisher Publisher CED CED Publisher Publisher Middleware Subscribe r CED Subscribe r 29
  • 30. Summary • Middleware is an important abstraction for building distributed systems 1. 2. 3. 4. • • • • Middleware Remote Procedure Call Object-Oriented Middleware Message-Oriented Middleware Event-Based Middleware Synchronous vs. asynchronous communication Scalability, many-to-many communication Language integration Ubiquitous systems, mobile systems 30