Web Services - Concepts, Architecture and Applications Part 3: Asynchronous middleware

Similar documents
Gustavo Alonso, ETH Zürich. Web services: Concepts, Architectures and Applications - Chapter 1 2

Chapter 1: Distributed Information Systems

Disadvantages of sync C/S. Extending RPC: Message Oriented Middleware

Lecture 3: Synchronous Interaction Patterns Traditional Middleware

DS 2009: middleware. David Evans

Communication. Outline

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Today: Distributed Objects. Distributed Objects

MTAT Enterprise System Integration. Lecture 2: Middleware & Web Services

Chapter 4 Communication

Networks and Operating Systems Chapter 3: Remote Procedure Call (RPC)

Simple Object Access Protocol (SOAP) Reference: 1. Web Services, Gustavo Alonso et. al., Springer

Information Systems Engineering Distributed and Mobile Information Systems

Networked Systems and Services, Fall 2018 Chapter 4. Jussi Kangasharju Markku Kojo Lea Kutvonen

9. Queued Transaction Processing

Lesson 3 SOAP message structure

3C05 - Advanced Software Engineering Thursday, April 29, 2004

Connecting ESRI to Anything: EAI Solutions

Software Architecture Patterns

Lesson 5 Web Service Interface Definition (Part II)

MODELS OF DISTRIBUTED SYSTEMS

Communication. Distributed Systems Santa Clara University 2016

MOM MESSAGE ORIENTED MIDDLEWARE OVERVIEW OF MESSAGE ORIENTED MIDDLEWARE TECHNOLOGIES AND CONCEPTS. MOM Message Oriented Middleware

Chapter 2 Distributed Computing Infrastructure

CHAPTER 2. Introduction to Middleware Technologies

RESTful Web service composition with BPEL for REST

Middleware and Interprocess Communication

Lesson 6 Directory services (Part I)

Events Will Transform Application Servers

Leveraging Web Services Application Integration. David S. Linthicum CTO Mercator

Service Oriented Architectures Visions Concepts Reality

DISTRIBUTED COMPUTER SYSTEMS

Chapter 6: Simple Object Access Protocol (SOAP)

COMMUNICATION IN DISTRIBUTED SYSTEMS

Chapter Outline. Chapter 2 Distributed Information Systems Architecture. Distributed transactions (quick refresh) Layers of an information system

Ellipse Web Services Overview

MODELS OF DISTRIBUTED SYSTEMS

Overview. Communication types and role of Middleware Remote Procedure Call (RPC) Message Oriented Communication Multicasting 2/36

Interprocess Communication Tanenbaum, van Steen: Ch2 (Ch3) CoDoKi: Ch2, Ch3, Ch5

Today: Distributed Middleware. Middleware

Data Management in Application Servers. Dean Jacobs BEA Systems

(9A05803) WEB SERVICES (ELECTIVE - III)

Distributed Middleware. Distributed Objects

Distributed Object-Based Systems The WWW Architecture Web Services Handout 11 Part(a) EECS 591 Farnam Jahanian University of Michigan.

Two Phase Commit Protocol. Distributed Systems. Remote Procedure Calls (RPC) Network & Distributed Operating Systems. Network OS.

Chapter 2 Distributed Information Systems Architecture

Distributed Information Processing

Distributed Systems Principles and Paradigms

Enterprise Application Integration (Middleware)

Middleware: Challenges and Evolution from Procedural to Service Orientation

Middleware definitions and overview

Conception of Information Systems Part 5: Transaction Monitors

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

05 Indirect Communication

Verteilte Systeme (Distributed Systems)

Outline. Interprocess Communication. Interprocess Communication. Communication Models: Message Passing and shared Memory.

Data Modeling and Databases Ch 14: Data Replication. Gustavo Alonso, Ce Zhang Systems Group Department of Computer Science ETH Zürich

02 - Distributed Systems

Lecture 5: Object Interaction: RMI and RPC

5. Distributed Transactions. Distributed Systems Prof. Dr. Alexander Schill

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

DYNAMIC CONFIGURATION OF COLLABORATION IN NETWORKED ORGANISATIONS

Proposal for Business Transaction Protocol Version 1.0

Oracle8i Advanced Queuing. An Oracle Technical White Paper February 1999

Communication. Distributed Systems IT332

Conception of Information Systems Lecture 6: Transaction Monitors

Introduction to Database Replication

Distributed Systems Question Bank UNIT 1 Chapter 1 1. Define distributed systems. What are the significant issues of the distributed systems?

Distributed KIDS Labs 1

ActiveVOS Technologies

Distributed Systems in practice HS 2007

02 - Distributed Systems

CORBA Object Transaction Service

Dr Markus Hagenbuchner CSCI319 SIM. Distributed Systems Chapter 4 - Communication

Distributed Systems Principles and Paradigms. Chapter 04: Communication

Chapter 4 Communication

<Insert Picture Here> QCon: London 2009 Data Grid Design Patterns

DISTRIBUTED COMPUTER SYSTEMS

Fault Tolerance. Distributed Systems IT332

Chapter 11 - Data Replication Middleware

Using Optimistic Atomic Broadcast in Transaction Processing Systems

Electronic Payment Systems (1) E-cash

Chapter 2 System Models

CAS 703 Software Design

Communication. Overview

BEAAquaLogic. Service Bus. JPD Transport User Guide

Oracle Tuxedo. CORBA Technical Articles 11g Release 1 ( ) March 2010

Asynchronous and Synchronous Messaging with Web Services and XML Ronald Schmelzer Senior Analyst ZapThink, LLC

Outline. Definition of a Distributed System Goals of a Distributed System Types of Distributed Systems

Application Oriented Networks: An SOA Perspective

Asynchronous Web Services: From JAX-RPC to BPEL

Advanced Distributed Systems

Replication. Feb 10, 2016 CPSC 416

MCAP: Multiple Client Access Protocol Ravindra Singh Rathore SML College Jhunjhunu, Rajasthan India

Chapter Outline. Chapter 2 Distributed Information Systems Architecture. Layers of an information system. Design strategies.

Lesson 19 Software engineering aspects

Overview. Distributed Systems. Distributed Software Architecture Using Middleware. Components of a system are not always held on the same host

JOpera: A Toolkit for Efficient Visual Composition of Web Services

Chapter 5: Distributed objects and remote invocation

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

Transcription:

Web Services - Concepts, Architecture and Applications Part 3: Asynchronous middleware Gustavo Alonso and Cesare Pautasso Computer Science Department ETH Zürich alonso@inf.ethz.ch http://www.inf.ethz.ch/~alonso

Message oriented middleware ETH Zürich Part 3: Async. middleware 2

Server stub Queues in TP-Monitors Any synchronous middleware introduces a tight coupling between the caller and the called. Name and directory services help to minimize the effects of this coupling but the tight connection between components is nevertheless there. It also creates considerable problems when trying to implement certain properties or manage the interaction between client and servers (fault tolerance, availability, etc.) The first systems to provide alternatives were TP-Monitors which offered two choices: asynchronous RPC: client makes a call that returns immediately; the client is responsible for making a second call to get the results Reliable queuing systems (e.g., Encina, Tuxedo) where, instead of using procedure calls, client and server interact by exchanging messages. Making the messages persistent by storing them in queues added considerable flexibility to the system client service call get results Input queue server service return results ETH Zürich Part 3: Async. middleware 3 Client stub RPC support Output queue Input queue Reliable queuing system Output queue

Queues in practice To access a queue, a client or a server uses the queuing services, e.g., : put (enqueue) to place a message in a given queue get (dequeue) to read a message from a queue mput to put a message in multiple queues transfer a message from a queue to another In TP-Monitors, these services are implemented as RPC calls to an internal resource manager (the reliable queuing service) These calls can be made part of transaction using the same mechanisms of TRPC (the queuing system uses an XA interface and works like any other resource manager) client put put server get queue management Client stub (queuing service) Client stub (queuing service) get mput persistent repository Queuing server ETH Zürich Part 3: Async. middleware 4

Reliable queuing Reliable queuing turned out to be a very good idea and an excellent complement to synchronous interactions: Suitable to modular design: the code for making a request can be in a different module (even a different machine!) than the code for dealing with the response It is easier to design sophisticated distribution modes (multicast, transfers, replication, coalescing messages) and it also helps to handle communication sessions in a more abstract way More natural way to implement complex interactions request() do with answer queue queue receive process return ETH Zürich Part 3: Async. middleware 5

Queuing systems Input queue Input queue client Output queue Reliable queuing system Monitoring Administration Persistent storage Output queue Queuing systems implement asynchronous interactions. Each element in the system communicates with the rest via persistent queues. These queues store messages transactionally, guaranteeing that messages are there even after failures occur. Queuing systems offer significant advantages over traditional solutions in terms of fault tolerance and overall system flexibility: s do not need to be there at the time a request is made! Queues provide a way to communicate across heterogeneous networks and systems while still being able to make some assumptions about the behavior of the messages. They can be used when embedded (workflow, TP-Monitors) or by themselves (MQSeries, Tuxedo/Q). ETH Zürich Part 3: Async. middleware 6

Transactional queues Persistent queues are closely tied to transactional interaction: to send a message, it is written in the queue using 2PC messages between queues are exchanged using 2PC reading a message from a queue, processing it and writing the reply to another queue is all done under 2PC This introduces a significant overhead but it also provides considerable advantages. The overhead is not that important with local transactions (writing or reading to a local queue). Using transactional queues, the processing of messages and sending and receiving can be tied together into one single transactions so that atomicity is guaranteed. This solves a lot of problems! 2PC Output queue 2PC Input queue 2PC 2PC Input queue 2PC Output queue ETH Zürich Part 3: Async. middleware 7

Problems solved (I) SENDING RECEIVING 2PC 2PC Message is now persistent. If the node crashes, the message remains in the queue. Upon recovery, the can look in the queue and see which messages are there and which are not. Multiple s can write to the same queue, thereby multiplexing the channel. Arriving messages remain in the queue. If the node crashes, messages are not lost. The can now take its time to process messages. It is also possible for several s to read from the same queue. This allows to implement replicated services, do load balancing, and increase fault tolerance. ETH Zürich Part 3: Async. middleware 8

Problems solved (II) An can bundle within a single transaction reading a message from a queue, interacting with other systems, and writing the response to a queue. If a failure occurs, in all scenarios consistency is ensured: if the transaction was not completed, any interaction with other s is undone and the reading operation from the input queue is not committed: the message remains in the input queue. Upon recovery, the message can be processed again, thereby achieving exactly once semantics. If the transaction was completed, the write to the output queue is committed, i.e., the response remains in the queue. If replicated services are used, if one fails and the message remains in the input queue, it is safe for other services to take over this message. Input queue Output queue ETH Zürich Part 3: Async. middleware 9 2PC Message is either read or written Input queue 2PC Output queue

Implementation Persistent queues can be implemented as part of a database since the functionality needed is exactly that of a database: a transactional interface persistence of committed transactions advanced indexing and search capabilities Thus, messages in a queue become simple entries in a table. These entries can be manipulated like any other data in a database so that s using the queue can assign priorities, look for messages with given characteristics, trigger certain actions when messages of a particular kind arrive Output queue MSSG m1 m2 m3 m6 m4 m5 Input queue QUEUE q1 q3 q7 q5 q1 q1 ETH Zürich Part 3: Async. middleware 10

Advantages of queues in EAI Queuing management systems completely detach the two sides of an interaction as there is no direct call but a document exchange This makes the development of both sides of the interaction (e.g., client and server) completely independent and very flexible The interaction can be defined in terms of the document to exchange rather than the interface to invoke. This is a more natural approach in the business world where interactions tend to be document based From the scheduling point of view, it is much easier to deal with messages than with synchronous invocations. Technically, the infrastructure necessary to deal with messages is simpler than the infrastructure necessary to deal with synchronous calls. Especially if there are no fancy features added to the queues. Queues also have the advantage of being easily adaptable to communicate with systems, even systems outside the organization (e.g., plug a queue to an e-mail address) When working with messages, the effort in describing the interaction goes into the description of the message or document within the message. This can be done without knowledge of how the message will be processed. ETH Zürich Part 3: Async. middleware 11

Message brokers Queuing management systems take care only of implementing queues and moving messages from one place to another. It is not possible to associate any logic to the queues. Message brokers are advanced queuing systems that are capable of associating logic to the queues so that the queues no longer act as passive transmitter of messages but can actively process, transform, or route the message according to business rules associated with the queue. Plain queuing systems allow to implement asynchronous interaction. Message brokers allow to transform business processes into sequence of message exchanges between different s, exactly what is needed for EAI. Application logic Message broker ETH Zürich Part 3: Async. middleware 12

Message brokers across organizations Application logic Message broker Application logic Message broker ETH Zürich Part 3: Async. middleware 13

Limitations of message brokers Message brokers are very efficient and very flexible infrastructures for EAI provided: messages are not too big (granularity has to be fine) the mapping business process -> queues is well understood and well documented If one of these two constraints are not observed, problems might arise: The implementation of queuing systems and message brokers is largely still based on the same technology as conventional middleware (RPC). Such procedural or method interfaces are not made for passing large objects (e.g., a large document) but mostly basic types and references. If data flow is through references, it is outside the control of the system and some properties may be difficult to enforce (reliability, transactions, etc.) Associating logic to the queue can be very helpful in many s but distributing the logic of a business process across many queues makes the process very difficult to understand and there might not be a global description of the process. Usually, it is not a good idea to use a message broker in the same way one would use a workflow engine due to the lack of global view over what is happening. ETH Zürich Part 3: Async. middleware 14

Message oriented business exchanges ETH Zürich Part 3: Async. middleware 15

Old fashioned e-commerce... ETH Zürich Part 3: Async. middleware 16

Using Workflows with ebxml BEA WHICH IS NOW WIDELY USED AND EXPANDING ETH Zürich Part 3: Async. middleware 17

Message based interaction Message based interaction has several advantages over synchronous systems, particularly when the interaction involves different organizations and typical business transactions (where the response might not be immediate). Message based interaction has less of a client server flavor and more of an exchange of information between partners, this affects not only the way the interaction is implemented (as interconnected business processes) but also the technology used for that purpose. If the messages are standardized, then it is possible to create off-the-shelf systems that can process such messages. This was the original goal of EDI but the technology was not yet there. The Internet, XML, and the whole notion of Web services will probably now help to make this goal a reality at a lower cost and with less effort than was required before. Message based interaction is behind many of the most comprehensive models for electronic commerce (ebxml, xcbl, etc.) and will certainly have a decisive influence on how SOAP, WSDL and UDDI will evolve in the future. ETH Zürich Part 3: Async. middleware 18