Web Services

Kenneth M. Anderson <kena@cs.colorado.edu>

Lecture 03: Middleware

Copyright Notice

Some material in this lecture is adapted from the teaching materials of the book “Web Services: Concepts, Architectures and Applications” and is thus Copyright © 2003 Gustavo Alonso, ETH Zürich and/or Copyright © 2004 Springer-Verlag Berlin Heidelberg.

All other material is Copyright © 2006 Kenneth M. Anderson


Middleware facilitates and manages the interaction between applications across heterogeneous computing platforms. It is the architectural solution to the problem of integrating a collection of servers and applications under a common service interface.
    — Introduction to Chapter 2 of our Textbook

Programming Abstractions

Genealogy of Middleware

  • Today's application servers evolved from the classical types of middleware
  • TP Monitors, Object brokers, and Message brokers all evolved from specializations of RPC
  • RPC hides cross-platform communication details behind a procedure call
  • Sockets are an operating system interface to underlying communication protocols
  • Transmission Control Protocol (TCP) verifies correct delivery of data streams; User Datagram Protocol (UDP) delivers data packets without guarantees
  • Internet Protocol moves a packet of data from one node in a network to another node

Middleware as Infrastructure

Middleware as Infrastructure: DCE

Types of Middleware

RPC-Based Systems RPC is the most basic form of middleware. It is used as a foundation for all other types of middleware.
TP Monitors TP Monitors are the oldest and best-known form of middleware. They are also the most reliable, best tested, and most stable technology in the EAI arena. TP Monitors can be seen as RPC with transactional capabilities and are classified into TP-lite and TP-heavy systems.
Object Brokers A middleware platform that supports the use of RPC in object-oriented languages; aka RMI
Object Monitors TP Monitors extended with APIs in object-oriented languages
Message-Oriented Middleware A middleware system built around the model of asynchronous RPC and persistent message queues. Tools are provided to create a number of transactional, persistent queues and allow programs to manipulate both local and remote queues.
Message Brokers A specialization of MOM systems that can transform and/or filter messages as they move through message queues. They can also dynamically select message recipients based on the content of a message.

RPC in Three Slides: IDL and Client/Server Stubs

RPC in Three Slides: RPC using static bindings

RPC in Three Slides: RPC with dynamic bindings

RPC: What Can Go Wrong?

Transactional RPC to the Rescue!

Transactional RPC

TP Monitors

  • TP Monitors are middleware systems that provide transactional RPC
  • They, of course, provide basic RPC functionality (IDLs, name servers, stub compilers, etc.)
  • They add programming language abstractions for TRPC
  • They add a transaction manager for implementing TRPC
  • They add a monitor in charge of scheduling threads, assigning priorities, load balancing, etc.
  • They provide a run-time environment offering services that can support TRPC
  • and more... (tools for installing, managing, and monitoring the TP Monitor)

TP Monitors, continued

Object Brokers

Object Monitors: Best of Two Worlds

Message-Oriented Middleware (MOM)

Message Queues

  • MOMs provide message queues
  • Messages sent by clients are assigned to queues (typically by name)
  • When the recipient is ready, it retrieves its next message and processes it; this gives servers a lot of control
  • queues can also be shared among components
  • here, three components share the responsibility of processing messages in a single queue; a message in this queue is delivered to at most one of these components

Coming up Next