Introduction to Web Services, SOA, and ESBs

87
Introduction to Web Services, SOA, and ESBs The Enterprise Integration Perspective Odysseas Pentakalos, Ph.D. Chief Technology Officer SYSNET International, Inc. [email protected]

Transcript of Introduction to Web Services, SOA, and ESBs

Page 1: Introduction to Web Services, SOA, and ESBs

Introduction toWeb Services, SOA, and ESBs

The Enterprise Integration Perspective

Odysseas Pentakalos, Ph.D.

Chief Technology Officer

SYSNET International, Inc.

[email protected]

Page 2: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 2

Agenda

� Enterprise Application Integration

� Service Oriented Architecture

� Characteristics, Advantages, Disadvantages

� Web Services

� Characteristics, Advantages, Disadvantages

� Phase I, Phase II for SOA 2.0

� Enterprise Service Bus

� Characteristics, Advantages, Disadvantages

� Business Processes in a SOA

� BPEL, Current state

Page 3: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 3

Enterprise Application Integration

Definition from Webopedia:EAI is the unrestricted sharing of data and business processes throughout the networked applications or data sources in an organization.

Definition from Whatis.com:EAI is a business computing term for the plans, methods, and tools aimed at modernizing, consolidating, and coordinating the computer applications in an enterprise.

Page 4: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 4

Demand for Enterprise Integration

A number of business drivers are generating growing demand for Enterprise Integration

� Mergers and acquisitions

� Constant need to cut costs

� Constant need to streamline business processes

� Compliance with government regulations

Gartner just released some statistics around the worldwide application integration market…, finding a seven percent jump in spending from 2004 to 2005. Total revenue totaled $8.5 billion in 2005. Gartner says

it looks for a similar growth rate this year in the market.

Page 5: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 5

Requirements

Requirements on an Enterprise Integration solution:

� The solution should not cost much; remember the need for cost-cutting

� Should not require extensive changes to existing applications

� Can handle lots of traffic with high reliability

� Flexible so that management and reconfiguration is easy to do

Page 6: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 6

Enterprise Integration Challenges

� Typical environment consists of a collection of applications

� In-house systems: usually developed on the principle of expediency so extensibility and connectivity options are limited

� Packaged-applications: vendors prefer to keep their system closed and limit integration capabilities

Page 7: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 7

Enterprise Integration Challenges

The architect needs to reconcile incompatibilities and differences at multiple levels:

� Business processes are incompatible

� Data model variations at the syntactic and semantic level

� Differences in the technologies used for each system

� Differences in the timing at which systems operate

� Differences in the interaction patterns: synchronous versus asynchronous

From: “Understanding SOA with Web Services” by Eric Newcomer and Greg Lomow

Page 8: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 8

Enterprise Integration Approaches

Some of the possible ways of accomplishing integration

First taxonomy (from Enterprise Integration Patterns book):

� File Transfer

� Shared Database

� Remote Procedure Invocation

� Messaging

Another taxonomy (EIA JavaWorld article by Abraham Kang):

� Data-level integration

� User interface-level integration

� Application-level integration

Page 9: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 9

Enterprise Integration Scenario

� Loan Broker Scenario; this will be a running scenario throughout the presentation

Customer

Credit Bureau

BrokerBank

Bank

Bank

1

3

2

3

3

From: “Enterprise Integration Patterns” byHohpe and Woolf.

Page 10: Introduction to Web Services, SOA, and ESBs

Service Oriented Architecture

Page 11: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 11

Service Oriented Architecture (SOA)

� The definition of services that encapsulate reusable business function

� The use of explicit implementation independent interfaces to define services

� Loosely coupled; services are independent of other services

� Services are registered in a directory service so that they can be located during design or runtime

� Service definition is not dependent on transport protocol used to access it

� Service can be used in a location/platform/technology agnostic approach

Page 12: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 12

SOA Interaction Pattern

� This is the basic interaction pattern in a SOA-based application:

Consumer

Provider Registry1 : Register

2 : Find3 : Bind

Page 13: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 13

Service Granularity

From: “SOA Blueprints Concepts”, The Middleware Company Research Team.

Page 14: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 14

Service Types

Most people think of services as the request-reply type

� Request/Reply – receives information, does something and returns information

� Worker – performs a function or changes state

� Monitor – observes a process and generates events

� Agent – observes a process and takes action based on rules

� Aggregator – combines results from disparate sources

� Process – long running service that implements a business service

Page 15: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 15

SOA Vision

� Multiple applications utilize the services� Multiple service providers make services available� The lifetimes of the services and applications are fairly decoupled

CompositeApplication

CompositeApplication

CompositeApplication

Page 16: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 16

Is SOA a new concept?

� It is just a new name for a sought-after approach

� What about DCE, CORBA, RMI, DCOM?� Lack of industry wide standardization prevented complete interoperability and platform independence

� Transport protocols were proprietary or specific to distributed object technology

� Security concerns and firewalls prevented interaction across boundaries

� Bad timing with respect to availability of computational power and other industry dynamics

Page 17: Introduction to Web Services, SOA, and ESBs

Web Services

Page 18: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 18

Why Web Services for SOA?

� Earlier middleware technologies were:

� Did not support heterogeneous clients and platforms

� Could not work over the Internet

� Some of the choices were hard to use

� Most of the choices were expensive to buy and maintain

� Web Services address these issues !!

Page 19: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 19

XML: The Data Format

� eXtensible Markup Language (XML)

� An XML document is based on a hierarchy of elements and associated attributes

Page 20: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 20

XML Schema

� XML language for defining structure and constraints of an XML document

Page 21: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 21

XSLT: Transformation Language

� eXtensible Stylesheet Language Transformations

Page 22: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 22

Overview of SOAP

� Definition from SOAP 1.1 Spec

� “SOAP provides a simple and lightweight mechanism for exchanging structured and typed information between peers in a decentralized, distributed environment using XML. ..”

� Simplicity is a key requirement

� Extensibility is another key requirement

� Binding into the network is unspecified

� Supports various message exchange patterns:

� request/respond

� notification

� callback

Page 23: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 23

Structure of a SOAP Message

SOAP envelope

SOAP header

SOAP body

SOAP block

SOAP block

SOAP block

SOAP block

Page 24: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 24

Example SOAP Message

<soap:Envelopexmlns:sn="http://www.sysnetint.com/stockquote/"xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><soap:Header>

<h:from xmlns:h=http://www.sysnetint.com/Header>[email protected]

</h:from></soap:Header><soap:Body>

<sn:GetStockQuotePrice><sn:symbol>MSFT</sn:symbol>

</sn:GetStockQuotePrice></soap:Body>

</soap:Envelope>

Page 25: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 25

Example Web Service

getQuote(String symbol)

<soap:Envelope xmlns: …><soap:Body>

<m:getQuote xmlns="urn:xmethods-delayed-quotes“><symbol xsi:type="xsd:string">MSFT</symbol>

</m:getQuote></soap:Body>

</soap:Envelope>

HTTP

HTTP

<soap:Envelope xmlns: …><soap:Body>

<n:getQuoteResponse xmlns="urn:xmethods-delayed-quotes"><Result xsi:type="xsd:float">24.67</Result>

</n:getQuoteResponse></soap:Body>

</soap:Envelope>

Page 26: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 26

WSDL: Introduction

� Is an XML document itself with a given schema

� Describes the interface to a Web Service

� Separates the abstract definition of a service from the implementation

� Describes the what, the how, and the where of the Web Service

� Similar to predecessors such as IDL of CORBA and DCOM

Page 27: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 27

WSDL Describes Services

� Web Services Description Language (WSDL)

WSDL

Platform Tools

Client Stubs

Server Stubs

Client Impl.

Server Impl.

Requests

Page 28: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 28

WSDL: The description language

� Standard for describing services and their bindings.� <definitions>: is the container and defines name and namespaces for WSDL document.

� <types>: defines any custom data types that are passed in/out of the service.

� <message>: models the data that is exchanged within method calls

� <portType>: operations supported through an endpoint of a web service

� <binding>: associates a portType with a protocol

� <service>: associates a binding with a specific URL

Page 29: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 29

WSDL: Sample document

� Demo of sample from W3C

Page 30: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 30

UDDI History

� Originally defined for the purpose of providing a public business and service registry

� First few versions came out through UDDI.org

� UDDI v3.0 is an OASIS standard

� Currently private registries are more popular in support of SOA-based applications

Page 31: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 31

UDDI Basic Concepts

� Defines a number of elements as part of the data model

� businessEntity, businessService, bindingTemplate, tModel

� Data Model takes the form of an XML document

� Spec defines APIs for inquiry, publication, and security

� The UDDI registry itself is exposed as a set of Web Services

Page 32: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 32

UDDI Scenarios

� Design time use

Developer searches through the private registry for existing services that can take part in an orchestrated application

Interest is in the functionality but not the specific instances

� Run time use

Application searches through the private registry for the service but focus is now on implementations of it

Page 33: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 33

EAI using Web Services

UDDI Server

WSDLWSDL

WSDL

Query

Invoke

Query

Invoke

Page 34: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 34

Web Services: Phase 1

� Services were developed to support a specific purpose

� Registration of interfaces is not necessary

� Discovery and utilization of interfaces is done at design time

� Web Services provide platform independence

CompositeApplication

Page 35: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 35

Loan Broker with Web Services

Page 36: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 36

Web Services-based Integration

� Advantages (Tactical Approach)

� Easy to implement

� Fairly low cost

� Does not require enterprise-wide agreements

� Disadvantages

� Fairly limited in terms of message exchange patterns

� Lower reusability of the services

� Consistency across web services implementations is limited

Page 37: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 37

SOA Vision

� Multiple applications utilize the services� Multiple service providers make services available� The lifetimes of the services and application are fairly decoupled

CompositeApplication

CompositeApplication

CompositeApplication

Page 38: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 38

WS-* Standards

� WS-Addressing – Need a standard approach for naming endpoints across protocols

� WS-ReliableMessaging – Need to support reliable messaging on top or unreliable protocols

� WS-Coordination/WS-Transactions – Need to support transactions across services

� WS-Security – Security is crucial for Web Services

� WS-Policy – Need to be able to specify non-functional and QoS requirements.

Page 39: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 39

WS-Addressing

Page 40: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 40

Why do we need Addressing?

� To find a Web Service you need a URL. Simple right?

� Address the web service with the URL, set the action in the HTTP headers and you are set.

� How about intermediaries?

� How about SOAP over non-HTTP protocol?

� How about dynamically generated web services?

Page 41: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 41

Basic Concepts: Endpoint References

� Endpoint references:

� Dynamic generation and customization of service endpoint descriptions.

� Referencing and description of specific service instances that are created as the result of stateful interactions.

� Flexible and dynamic exchange of endpoint information in tightly coupled environments where communicating parties share a set of common assumptions about specific policies or protocols that are used during the interaction.

Page 42: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 42

Endpoint Reference Definition

� An Endpoint Reference consists of:� Address: is a URI and identifies the address of the endpoint

� ReferenceParameters: XML elements that are necessary in order to successfully interact with the web service

� Metadata: provides an extensible container for metadata that describes the endpoint

<wsa:EndpointReferencexmlns:wsa="http://www.w3.org/2005/03/addressing"><wsa:Address>http://example.com/fabrikam/acct</wsa:Address></wsa:EndpointReference>

Page 43: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 43

Message Information Headers

� Message Information Headers: headers to allow messages to be addressed to an endpoint all within the SOAP message.

� To: The URL of the target service

<wsa:To>http://localhost/MyServiceTest</wsa:To>

� From: The ERP of the message’s sender.

<wsa:From>

<wsa:Address>http://localhost/YourService</wsa:Address>

</wsa:From>

Page 44: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 44

Message Information Headers

� ReplyTo: The ERP to which the response should be sent to.

� FaultTo: The ERP to which the SOAP fault should be sent to.

� MessageID: Is a URI that uniquely identifies the message

� Action: Takes the place of the SOAPAction

� RelatesTo: Element that indicates the MessageID of the caller.

Page 45: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 45

WS-Reliable Messaging

Page 46: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 46

Why do we need Reliable Messaging?

� Network failures may prevent messages from being delivered

� Middleware failures may cause messages from being delivered

� Intermittent failures may cause duplicates

� Routing delays may cause out of order delivery

Page 47: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 47

WS-Reliable Messaging Concepts

� Sequence: reliable messaging is enforced within the context of a sequence between two endpoints

� Acknowledgments: an ack from the server indicates the sequence range of messages received

� Delivery Assurance Policy: endpoints can negotiate the delivery policy

Page 48: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 48

Reliable Messaging Model

ApplicationSource

Initial Sender

ApplicationSource

Ultimate Receiver

Send Delivery

RM SourceTransmit

RM DestinationReceiveAcknowledge

Page 49: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 49

Reliable Messaging ProtocolEndpoint

AEndpoint

BCreate Sequence

Create Sequence Response (Identifier)

Sequence (Identifier, MessageNumber=1)

Sequence (Identifier, MessageNumber=2)

Sequence (Identifier, MessageNumber=3, LastMessage)

Sequence Ack. (Identifier, Range=1,3)

Sequence (Identifier, MessageNumber=2)

Sequence Ack. (Identifier, Range=1..3)

Terminate Sequence

Page 50: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 50

Sequence Message

<wsrm:Sequence ...>

<wsu:Identifier> [URI] </wsu:Identifier>

<wsrm:MessageNumber> [unsignedLong] </wsrm:MessageNumber>

<wsrm:LastMessage/>?

<wsu:Expires> [dateTime] </wsu:Expires>?

...

</wsrm:Sequence>

Page 51: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 51

Sequence Example

<wsrm:Sequence>

<wsu:Identifier>

http://fabrikam123.com/abc

</wsu:Identifier>

<wsrm:MessageNumber>10</wsrm:MessageNumber>

<wsrm:LastMessage/>

</wsrm:Sequence>

Page 52: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 52

Sequence Acknowledgement

<wsrm:SequenceAcknowledgement ...>

<wsu:Identifier> [URI] </wsu:Identifier>

[ <wsrm:AcknowledgementRange ...

Upper="[unsignedLong]"

Lower="[unsignedLong]"/> +

| <wsrm:Nack>[unsignedLong]</wsrm:Nack> + ]

...

<wsrm:SequenceAcknowledgement>

Page 53: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 53

Sequence Ack Example

<wsrm:SequenceAcknowledgement>

<wsu:Identifier>

http://fabrikam123.com/abc

</wsu:Identifier>

<wsrm:AcknowledgementRange Upper="2" Lower="1"/>

<wsrm:AcknowledgementRange Upper="6" Lower="4"/>

<wsrm:AcknowledgementRange Upper="10" Lower="8"/>

</wsrm:SequenceAcknowledgement>

Page 54: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 54

Create Sequence Message

Request

<wsrm:CreateSequence ...>

...

</wsrm:CreateSequence>

Response

<wsrm:CreateSequenceResponse ...>

<wsu:Identifier> [URI] </wsu:Identifier>

...

</wsrm:CreateSequenceResponse>

Page 55: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 55

Sequence Termination

<wsrm:TerminateSequence ...>

<wsu:Identifier> [URI] </wsu:Identifier>

...

</wsrm:TerminateSequence>

Page 56: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 56

Transactions

Page 57: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 57

Why do we need Transactions?

� In an application based on an orchestration of Web Services all services involved in an operation must come to an undisputed resolution.

� Typical ACID semantics are useful for some but long-running transactions need different transactional support.

Page 58: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 58

Atomic Transactions

� Atomicity: on completion either all actions or none are completed.

� Consistency: consistency is the system is preserved after processing multiple concurrent transactions

� Isolation: intermediate states of the system are not observable outside the transaction

� Durability: if a transaction commits, the changes are preserved even in after a system failure

Page 59: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 59

Business Transactions

� Long-running transactions: transactions may take hours, days or weeks to complete

� Need to be able to select a subset of the original participants before a commit

� Compensating transactions: operations that are used to restore the state in case of a failure

Page 60: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 60

Standards and scope

� WS-Coordination:

� allows a distributed system to establish a group of participantsaround an activity

� participants can register interest in participating in the outcome

� Coordination protocol can vary but operates upon completion of the activity

� WS-Atomic:

� Handles ACID transactions and defines variations of 2PC

� WS-Business Activity:

� Allows for the definition of nested scopes of operations

� Allows for the definition of compensating transactions

Page 61: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 61

Coordinator

Page 62: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 62

Interactions for Coordination

Page 63: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 63

Why do we need Security?

� Protect messages from someone eavesdropping on the network

� Prevent tampering with the messages

� Currently security for web services is done at the transport layer (SSL).

� This won’t work when the same message has multiple links to traverse

� Need the ability to selectively encrypt parts of the message.

Page 64: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 64

WS-Security Specifications

� Authentication Profiles

� Username/password

� Kerberos

� X.509 Certificates

� Message Integrity

� XML Signature

� XML Key Management

� Message Confidentiality

� XML Encryption

Page 65: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 65

SOA for Enterprise Integration

� They all need to talk to one another despite running on top of different protocols

� They need support for all the WS-* services we talked about

� The data structures between the elements may not be identical

� Need to be able to support various message exchange patterns

Service ServiceService

Service ServiceService

Service

Page 66: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 66

Enterprise Service Bus (ESB)

� Abstract the development of service components from wire protocol and deployment platform from below and the business processes above

� Facilitates the requirements of a highly-scalable, fault-tolerant, message-driven, service-oriented enterprise.

� Utilizes XML and related-technologies for unifying the message format

� Provides transformation and routing capabilities to the bus as a service

� Provides centralized management capabilities of the distributed services components

Page 67: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 67

ESB Architecture

Provides a standards-based bus and adapters for multiple transports and protocols along with common services

Page 68: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 68

Java Business Integration

� High-level architecture of JBI framework (JSR 208)

Page 69: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 69

Business Processes

� Composition of services into a business process

ClientTravel

Reservation

United AirlineReservations

Delta AirlineReservations

Hertz CarReservations

HotelReservations

Page 70: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 70

BPEL

� Business Process Execution Language:

� Language for describing business processes

� Convergence of a number of earlier efforts (WSFL, XLANG)

� Invoke operations in synchronous/asynchronous mode

� Invoke operations sequentially or in parallel

� Define fault and transaction handling

� Compose business processes from business processes

Page 71: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 71

Loan Broker with BPEL

� Broker is defined as a BPEL document

Customer

Credit Bureau

BPELProcess

Bank

Bank

Bank

1

3

2

3

3

Page 72: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 72

Enterprise Integration Design Patterns

Design patterns for Enterprise Integration

� Fill the gap between high-level architecture and implementation

Pattern Classification

� Messaging Systems: basic concepts in integration with messaging

� Messaging Channels: describe channels used for integration

� Message Construction: describe message types and intent

� Message Routing: describes provision of routing and brokering

� Message Transformation: variations of message translator

� Messaging Endpoints: connecting to and from the messaging system

� System Management: management of the integration infrastructure

Page 73: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 73

Sample EI Patterns

� Messaging Channels

� Datatype Channel: all messages on a given channel are of the same type

� Invalid Message Channel:what to do about invalid messages.

� Dead Letter Channel: what to do about undeliverable messages.

Page 74: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 74

Sample EI Patterns

Messaging Routing

� Content-based Router: routes message based on the message’s content

� Recipient List: routes message to dynamic list of recipients

� Splitter/Aggregator: one splits message into sub-messages; other one aggregates back into one

Page 75: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 75

Application of EIP

Loan Broker using Enterprise Integration Patterns

Customer

Credit Agency

Endpoint

Data Enricher

Recipient List

Aggregator Normalizer Translators

Page 76: Introduction to Web Services, SOA, and ESBs

Mule: Enterprise Service Bus

Page 77: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 77

Mule EIP Server

� Mule is an open source framework based on the concept of an ESB (mule.codehaus.org)

� What’s with the name?

� Follows an event-driven architecture

� System consists of producers, consumers and a message server

� Configuration of the routing of events between components takes place outside the scope of consumers/producers

� Container follows the SEDA architecture model

� Master’s thesis work of Matt Welsh at UC Berkeley (http://www.eecs.harvard.edu/~mdw/proj/seda/)

Page 78: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 78

Mule Architecture

Page 79: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 79

Conclusion

� SOA has great potential for finally achieving reusability

� Web Services is the platform that will make SOA a reality

� Existing holes to achieve the full vision are currently in development or production

� An Enterprise Service Bus provides the glue to make SOA a reality today

Page 80: Introduction to Web Services, SOA, and ESBs

Backup Slides

Page 81: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 81

Mule Configuration

An XML file defines the integration model:

� connector: Configuration of the components that attaches to the various providers

� container-context: Configuration of the container that will provide the components

� endpoint-identifiers: Configuration of endpoints that provide services

� interceptors: code to execute before and/or after a component

� model: Configuration of the components (UMO) that implement the services

Page 82: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 82

Mule-based Loan Broker

Loan Broker

Credit AgencyGateway

Credit Agency

LenderService

BankingGateway

Bank 1

Bank 2

Bank n

Page 83: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 83

Service Definition

� Loan Broker: (REST Web Service) receives requests for loan quotes

� Credit Agency: (EJB Service) provides credit information about the customer

� Lender Service: (Web Service) receives customer loan requests with credit information and forwards requests to appropriate banks

� Banks: (Web Service) provide quotes on customer loan requests based on request and credit information

Page 84: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 84

Endpoint Definition

<endpoint-identifiers><endpoint-identifier name="LoanBrokerRequestsREST"

value="jetty:rest://localhost:8080/loanbroker"/><endpoint-identifier name="LoanBrokerRequests"

value="vm://loan.broker.requests"/><endpoint-identifier name="LoanQuotes" value="jms://esb.loan.quotes"/><endpoint-identifier name="CreditAgencyGateway" value="jms://esb.credit.agency"/><endpoint-identifier name="CreditAgency"

value="ejb://localhost:1099/local/CreditAgency?method=getCreditProfile"/><endpoint-identifier name="LenderGateway" value="jms://esb.lender.service"/><endpoint-identifier name="LenderService" value="vm://lender.service"/><endpoint-identifier name="BankingGateway" value="jms://esb.banks"/><endpoint-identifier name="Bank1" value="axis:http://localhost:10080/mule"/><endpoint-identifier name="Bank2" value="axis:http://localhost:20080/mule"/><endpoint-identifier name="Bank3" value="axis:http://localhost:30080/mule"/><endpoint-identifier name="Bank4" value="axis:http://localhost:40080/mule"/><endpoint-identifier name="Bank5" value="axis:http://localhost:50080/mule"/>

</endpoint-identifiers>

Page 85: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 85

Loan Broker Definition

<model name="loan-broker"><!-- The loan broker is used to receive loan requests --><mule-descriptor name="LoanBroker"implementation="org.mule.samples.loanbroker.esb.LoanBroker"><inbound-router><endpoint address="LoanBrokerReqREST“ transformers=“RestReqToCustReq”/><endpoint address="LoanBrokerRequests"/>

</inbound-router><outbound-router><router className="org….outbound.OutboundPassThroughRouter"><endpoint address="CreditAgencyGateway"/>

</router></outbound-router><response-router timeout="1000000"><endpoint address="LoanQuotes"/><router className="org…..routers.BankQuotesResponseAggregator"/>

</response-router></mule-descriptor>

Page 86: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 86

Credit Agency Definition

<!-- The credit agency service will get the credit profile for a customer --><mule-descriptor name="CreditAgencyGateway"

implementation="org.mule.components.builder.ReflectionMessageBuilder"><inbound-router>

<endpoint address="CreditAgencyGateway"/></inbound-router><outbound-router>

<router className="org.mule….FilteringOutboundRouter"><endpoint remoteSync="true“

transformers="LoanQuoteRequestToCreditProfileArgs"responseTransformers="CreditProfileXmlToCreditProfile“address="CreditAgency"/>

<endpoint address="LenderGateway"/></router>

</outbound-router></mule-descriptor>

Page 87: Introduction to Web Services, SOA, and ESBs

Copyright 2006 SYSNET International, Inc. 87

Banking Gateway Definition

<mule-descriptor name="BankingGateway"implementation="org.mule….BridgeComponent"><inbound-router><endpoint address="BankingGateway"/>

</inbound-router>1<outbound-router><router className="org….StaticRecipientList"><reply-to address="LoanQuotes"/>

</router></outbound-router>

</mule-descriptor>