getting to know openesb - austin java users...

47
Getting to Know OpenESB By Rob Ratcliff May 3 rd , 2011

Upload: vanthuy

Post on 01-Apr-2018

234 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Getting to Know OpenESB

By

Rob Ratcliff

May 3rd, 2011

Page 2: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

About Me● Developing with Java since 1995● Founded the Austin Java Users Group in 2001● Been involved in system integration for 17 years –

architected and still support a CORBA-based integration framework called MDOPT

● Used OpenESB to develop a generic planning service that delegated to other third party planning services

● Used Glassfish to support a planning service● Lots of experience developing GUIs with Swing.

Presented at JavaOne in 2007: http://www.futuretek.com/presents/javaone2007/TS-3723

Page 3: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

MDOPT Architecture

Page 4: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Outline Introduction to OpenESB

Java Business Integration (JBI)

Normalized Message Router

Binding Components

Service Engines

Developing a Geocoding Service

Code walk through of a Travel Reservation Application

Advanced Topics

Versioning WSDL and Schemas

An EJB approach to consuming services with different versions of the same schema

OpenESB/Glassfish/Sun Web Server approach to clustering

Enabling compression of the XML responses with a front end web server

Current shortcomings and future direction of OpenESB

Page 5: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Why Use and ESB

Desire dependent services to be decoupled

Need to support multiple protocols Need to support multiple data formats Desire best of breed services to be

swapped out behind the scenes Desire a common interface that acts as a

proxy to other third party services Draw from library of components and

services

Page 6: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

History

SeeBeyond 1992: DataGate 1999: eGate 2003: ICAN/Java CAPS 2008: OpenESB/Glassfish ESB v2 2009: OpenESB v2.2 released 2008 OpenESB v3 (Project Fuji) started – M10+

Sun bought SeeBeyond in 2005 for $387M Oracle bought Sun 2009 $7.4B put OpenESB

into maintenance mode Open source community adopted OpenESB

2010 (LogiCoy, Pymma, ForgeRock)

Page 7: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Glassfish OpenESB Features Architecture embraces diverse protocols and data formats

Binding Components (BC) to adapt protocols (FTP, HTTP, CORBA, file based, proprietary)

Service Engine (SE) to provide translation and high level business logic (XSLT, BPEL, Translators)

Normalized Message Router to decouple modules and provide uniform communication model

Open source Based on Glassfish JEE application server with proven

track record Based on Java Business Integration (JBI), WSDL, XML

Schema and other open standards Product has been used in high volume telecom and

health insurance projects

Page 8: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Glassfish OpenESB Open source framework and standards

based software development productsGlassfish ESBJAVA, XML, WSDL, JAXWS, BPEL, JEE, JBI,

JMS, etc

Allows services to be decoupled Supports multiple protocols and formats Very WSDL/XML/BPEL/XML-Schema

centric – if you like XML, you'll like OpenESB

Page 9: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Miscellaneous

Other ServicesLoggingNotificationPerformance Monitoring

Other Protocols supported such as File, FTP, JMS, CORBA

Service Engines – XSLT, POJO

Page 10: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

High Level Architecture

Ref: http://kalali.me/introducing-openesb-from-development-to-administration-and-management/

Page 11: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

JBI Overview

Page 12: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Representative Binding Components

CORBA(JBI4CORBA) Database HTTP/SOAP REST JMS HL7 (and encoder)

Email Exec File Scheduler LDAP FTP

Provides External Communication with other Services

Page 13: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Representative Service Engines

BPEL – Business Process Orchestration Engine

JAVAEE – EJB communication POJO – Local Java Object Interface XSLT – XSLT style sheet engine, support

XSLT 1.0 and 2.0 IEP – Intelligent Event Processor

Page 14: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

WSDL-Centric Messaging Model• Abstract service model - A service is defined using an abstract messaging model, without reference to a particular protocol or wire encoding

• Concrete (bound) model - An abstract service that is bound to a particular protocol and communications end point.

Page 15: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Normalized Message Router - NMR

In memory message router allowsPerformance improvement by reducing inter-

component messaging overhead of JMS (when no network is required)

Message streaming – pass by referencePropagation of security and transaction

contextEasy throttling

Page 16: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Normalized Message Router

Key to interoperation between components

Mediated Message Exchange Normalized Message

Abstract Message (payload – usually XML, but can be any data type)

Message Properties (metadata) Message Exchange Pattern

Support for simple communications primitives

Page 17: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Endpoint Identification

Endpoints in JBI are uniquely identified– PortType– PartnerLink– Role name

These three values correspond– Interface-name– Service-name– Endpoint-name (Provider or Consumer)

Page 18: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

NMR Message API

Page 19: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

NMR Service API

Page 20: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Life Cycle Management

Page 21: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

NetBeans Schema Editor

Page 22: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

NetBeans WSDL Editor

Page 23: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

BPEL Editor

Page 24: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

BPEL Input/Output Mapper

Page 25: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Exposing the Service in a Composite Application

Page 26: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Deployed to Glassfish Server

Page 27: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Development of a Geocoder Application

Page 28: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Developing a Geocoder Application Creating a new schema with the XML Schema Editor Creating new abstract WSDLs with the WSDL Editor BPEL Editor

Creating a process flow Enhancing BPEL by calling out to local Java static methods

Creating and calling a POJO Calling an external service Calling the XSLT engine to transform your XML Composite Application Editor Adding Concrete Implementation to the BPEL Process Flow Customizing the BCs with the Binding Component Editor Deployment to Glassfish Glassfish Admin interface walk-through Creating a SOAP client to communicate with the service and integration

with World Wind

Page 29: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Geocoder Process Flow

YahooGeocoder

GoogleGeocoder

HTTPBC

HTTPBC

BPELProcess

FlowHTTPBCSOAP

Client

Page 30: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Walk Through of the Travel Reservation Application

Page 31: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Walk Through and Demo of the Geocoder Application

Page 32: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

HINTS Use only document literal web services Use fully qualified XSDs

(elementFormDefault="qualified“) Use elements for document literal web

services only Add reference to the actual jar of the Java

utility library to the BPEL project for Java call outs

Page 33: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Advanced Topics

Page 34: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Schema and WSDL Versioning

Come up with a versioning scheme early in the development

Some approachesTransform inputs and output based on version

identifier (e.g. Google Maps) Version Namespace

• Provide versioned WSDL end point (Bing Maps)

• Change namespace of Schema

Page 35: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Supporting Evolving Interfaces and Data Structure

Two typical approaches to handle versioning Change the target namespace of the Schema or WSDL to

incorporate a “Version Identifier”. Example: http://www.austinjug.org/geocoder/v2/p3

Add a “Version” element to the Schema definitionExample: <Version>v2.3</Version>

Context based routing used to convert one version to another version or couple to a given version of the service

“Unix Pipe” based approach

Page 36: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

IONO's Recommendations➢ Place the major version number in the WSDL target

namespace, and in the name of the WSDL file.

➢ Version data types according to XSD conventions, and import types into your WSDL contract

➢ Avoid embedding versioning information in message names

➢ Embed major-minor version in the interface (portType) name to allow backward compatible interfaces

➢ Embed major-minor version in the service name (service name follows same convention as the interface

Page 37: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

IONO's Recommendations Continued➢ Facilitate the addition of new operations as minor point

releases

➢ Create a new service for each version of an interface

➢ Facilitate change of existing operations only as major point releases

➢ Regard any change to the XSD type system as a major release

➢ Keep major releases of deprecated services live until they are no longer in use

Reference:

Adrian Trenamanblogs.iona.com/sos/20070410-WSDL-Versioning-Best-Practise.pdf

Page 38: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Bing Maps Geocoder ExampleWeb service versioned:http://dev.virtualearth.net/webservices/v1/metadata/geocodeservice

/geocodeservice.wsdl

SchemaLocation: http://dev.virtualearth.net/webservices/v1/metadata/geocodeservice

/GeocodeService.xsd

http://dev.virtualearth.net/webservices/v1/metadata/geocodeservice/GeocodeService3.xsd

Namespaces:http://dev.virtualearth.net/webservices/v1/geocode/contracts

http://schemas.microsoft.com/2003/10/Serialization/Arrays

(Looks like they stopped using dates recently...makes messy packages.)

Page 39: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Using EJB Clients Eliminate Namespace Collisions

● Create public interface that's independent of the remote service's schema

● EJB implementation does not expose JAXB objects created from remote service

● Servlet looks up EJB via JNDI to invoke service via the EJB

● Servlet's classloader is not polluted by the remote service's JAXB objects

Page 40: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Oracle IPlanet Web ServerLoad Balancer

GeocoderService

GeocodeRequest

GeocoderService

Page 41: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Setting Up Clustering

AS_ADMIN_PROFILE=developer by default, change this to “cluster”

ant –f setup-cluster.xml glassfish/bin/asadmin start-domain domain1 glassfish/nodeagents/localhost/agent/bin/startser

v Create clusters using the admin interface Add favorite load balancer (not trivial) Note: ${default_port} of JBI service is replaced

automatically by clustered instance to the actual port used

Page 42: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Adding GZIP Compression

Compressing XML is essential in reducing bandwidth – XML compresses by 80-1 for some cases!

HTTPBC does not support compression currently

Use Web server (Apache or Sun) acting as the load balancer to proxy the requests and provide compression

– Add prefix to JBI end points to redirect all JBI service requests to the correct port

Page 43: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Current Developments in OpenESB

Ported to NetBeans 6.9 recently (very much improved over 6.7.1)

Project Fuji in the works

– Supports Glassfish version 3

– Andi Egloff left Oracle and joined ForgeRock as chief architect to develop Fuji in January, 2011. (OpenESB underlies OpenIDM)

OpenESB Summit Next Monday (May 9th in Los Angeles and workshop in Montreal, Quebec May 12th and soon in Bangelore.

Open source community looking for volunteers!

Page 44: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Opportunities for Improvement Tend to duplicate schema and WSDL definitions across the

various JBI modules NetBeans OpenESB modules are a little buggy and

sometimes need to be restarted to synchronize state Creating WSDL/Schema for each interface is a little tedious Must know WSDL and Schema very well and decent

knowledge of XSL and BPEL Refactoring WSDL, Schemas and BPEL require manual

editing sometimes to handle all dependencies (seems better in NB 6.9)

Importing a schema into a WSDL document doesn’t automatically add the schemaLocation attribute

Not ported to Glassfish 3.x yet

Page 45: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Opportunities to Improve Glassfish 2.1

1)Too many dependencies on native libraries

2)Load balancer is native code and is not open source

3)Time consuming to setup load balancer, especially with the open source version of Glassfish 2.1

4)Can't restart admin server from web interface

5)Node agent can't be started from web interface

Note: Many of these have been improved with v3.1!Note: Many of these have been improved with v3.1!

– ssh used across machines

– OSGI based

– Seems snappier and more robust in terms of status updates

Page 46: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

References OpenESB 2.2 Downloads:

http://www.logicoy.com/download_glass

OpenESB 2.3 Downloads:http://hudson.openesb-dev.org:8080/hudson/job/openesb-installers-legacy/

OpenESB 2.3 Project Website: https://openesb-dev.org/

JBI Specification: JSR-000208 Java Business Integration 1.0 Final Release

TutorialsTom Barrett's Tutorials: http://tinyurl.com/yk6oxsdhttp://wiki.open-esb.java.net/Wiki.jsp?page=OpenESBIntroductionTutorialhttp://blogs.sun.com/kevansplace/entry/how_to_use_the_xslt

Tons of blogs and tutorials, just Google OpenESB (I'll email a list of references out to the AustinJUG list as well)

Versioning: blogs.iona.com/sos/20070410-WSDL-Versioning-Best-Practise.pdf

Page 47: Getting to Know OpenESB - Austin Java Users Groupaustinjug.org/presentations/openesb-ratcliff-05032011.pdf · 2011. (OpenESB underlies OpenIDM)

Glassfish OpenESBIntroduction to OpenESB and rationale for choosing an ESBOverview of Java Business Integration (JBI) and the OpenESB Architecture

Normalized Message Router Service Engines Binding Components Composite Applications

Demonstration of creating and deploying a representative sample service that supports multiple protocols with behind the scenes explanations

Creating a new schema with the XML Schema EditorCreating new abstract WSDLs with the WSDL Editor BPEL Editor

Creating a process flowEnhancing BPEL by calling out to local Java static methodsCreating and calling a POJO Calling an external service Calling the XSLT engine to transform your XML

Composite Application Editor Joining the BPEL process with the concrete servicesCustomizing the BCs with the Binding Component Editor

Deployment to Glassfish Glassfish Admin interface walk-through Creating a SOAP client to communicate with the service

Advanced concepts Versioning Services and Schemas

Namespace and WSDL naming tricks Version IDs

An EJB approach to consuming services with different versions of the same schemaOpenESB/Glassfish/Sun Web Server approach to clustering Enabling compression of the XML responses with a front end web server

Current shortcomings and future direction of OpenESB

Detailed Outline