58
Do we need ESB any more? Artur Karaźniewicz

Do We Need Esb Any More

Embed Size (px)

DESCRIPTION

Presentation I gave for Javarsovia 2008 conference (www.javarsovia.pl)

Citation preview

Page 1: Do We Need Esb Any More

Do we need ESB any more?

Artur Karaźniewicz

Page 2: Do We Need Esb Any More

About me

• Artur Karaźniewicz - Chief Integration And Solution Architect, Integration Team Leader - Allianz Poland

• Working with Java since 1999 (JServ anybody?)

• Experience in Financial Services

Page 3: Do We Need Esb Any More

First things first, but not necessarily in that order. First things first, but not necessarily in that order. -- Doctor Who-- Doctor Who

What’s an ESB?

Page 4: Do We Need Esb Any More

What’s an ESBEnterprise Service Bus - term first coined by Gartner around 2002 (although few others claim They coined the term before)

(Enterprise Service Bus) Universal integration backbone. An (Enterprise Service Bus) Universal integration backbone. An ESB acts as a shared messaging layer for connecting ESB acts as a shared messaging layer for connecting

applications and other services throughout an enterprise applications and other services throughout an enterprise computing infrastructure. It supplements its core computing infrastructure. It supplements its core

asynchronous asynchronous messaging backbonemessaging backbone with intelligent with intelligent transformation and routingtransformation and routing to ensure messages are passed to ensure messages are passed

reliably. Services participate in the ESB using either reliably. Services participate in the ESB using either web web servicesservices messaging standards or the Java Message System messaging standards or the Java Message System

(JMS).(JMS).

Page 5: Do We Need Esb Any More

What’s an ESBSonic Software, one of the first ESB bandwagon members has it's own definition

An ESB is software infrastructure that simplifies the An ESB is software infrastructure that simplifies the integration and flexible reuse of business components using a integration and flexible reuse of business components using a

service-orientedservice-oriented architecture. An ESB makes it easy to architecture. An ESB makes it easy to dynamically connect, dynamically connect, mediatemediate and control services and their and control services and their

interactions.interactions.-- source -- source http://www.businessreviewonline.com/blog/archives/2005/12/does_sonics_esb.htmlhttp://www.businessreviewonline.com/blog/archives/2005/12/does_sonics_esb.html

Page 6: Do We Need Esb Any More

What’s an ESBIONA has little bit different perception what ESB actually is

In general we agree with Sonic's requirements for an In general we agree with Sonic's requirements for an ESB, at a technical level when it comes to how to ESB, at a technical level when it comes to how to

meet those requirements we think they have got it meet those requirements we think they have got it all wrong. [...] Specifically, he said that Iona believes all wrong. [...] Specifically, he said that Iona believes

Sonic's ESB is "overly JMS [Java Message Service] Sonic's ESB is "overly JMS [Java Message Service] and broker based".and broker based".

-- source http://www.businessreviewonline.com/blog/archives/2005/12/does_sonics_esb.html-- source http://www.businessreviewonline.com/blog/archives/2005/12/does_sonics_esb.html

Page 7: Do We Need Esb Any More

What’s an ESBPolarLake, another ESB Vendor adds another view

Great to see Sonic Software's definition converge Great to see Sonic Software's definition converge towards ours. In particular, they are correctly towards ours. In particular, they are correctly

identifying that identifying that mediationmediation - a term we have used for - a term we have used for quite some time - is the core feature of an ESB.quite some time - is the core feature of an ESB.

-- source -- source http://www.businessreviewonline.com/blog/archives/2005/12/does_sonics_esb.htmlhttp://www.businessreviewonline.com/blog/archives/2005/12/does_sonics_esb.html

Page 8: Do We Need Esb Any More

Odd that we think definitions are definitive. Odd that we think definitions are definitive. -- Larry Wall, Perl Creator-- Larry Wall, Perl Creator

So what’s ESB after all?

Page 9: Do We Need Esb Any More

So What’s an ESB, after all?

Messaging BackboneMessaging Backbone

Routing and mediationRouting and mediation

WS StackWS Stack Adapters/ConnectorsAdapters/Connectors

Legacy SystemsLegacy Systems

Page 10: Do We Need Esb Any More

• A little bit of distribution mechanisms

• Bus Architecture vs. Hub And Spoke

• Strong monitoring and management capabilities

• With little pinch of flexibility...

So What’s an ESB, after all?

Page 11: Do We Need Esb Any More

What ESB is not?• It’s not an Application Server!

• It’s not centralized nor monolithic

• It’s not BPMS (Business Process Management Suite)

• It’s not MOM

Page 12: Do We Need Esb Any More

For every complex problem, there is a solution that is simple, For every complex problem, there is a solution that is simple, neat, and wrong.neat, and wrong.

-- Henry Louis Mencken -- Henry Louis Mencken

What’s wrong with ESB, then?

Page 13: Do We Need Esb Any More

What’s wrong with ESB?

ESB

Page 14: Do We Need Esb Any More

What’s wrong with ESB?

• It looks Great!..

• ...But in practice - most ESBs are typical 80/20 solutions (or simple, neat and wrong)

• 80% of (simple) things are very easy to implement using of the shelve ESB

• 20% of things are extremely difficult to implement using of the shelve ESB

We have 80% of Perl6 done and we are now working on the next 80%.We have 80% of Perl6 done and we are now working on the next 80%.-- Anonymous Coward, slashdot.org, Perl 6 discussion-- Anonymous Coward, slashdot.org, Perl 6 discussion

Page 15: Do We Need Esb Any More

Examples?Excerpt from (some) ESB documentation

The Oracle Database adapter does not The Oracle Database adapter does not support the following data types: support the following data types: * PL/SQL TABLE * PL/SQL TABLE * TABLE * TABLE * VARRAY * VARRAY * OBJECT* OBJECTetc..etc..

Page 16: Do We Need Esb Any More

Examples?Excerpt from (some) ESB documentation

The Oracle Database adapter accepts a The Oracle Database adapter accepts a character data for a NUMBER field character data for a NUMBER field without throwing an error. In the without throwing an error. In the database, the character is stored as 0.database, the character is stored as 0.

Page 17: Do We Need Esb Any More

What’s wrong with ESB?

• Lack of sound community• “Community driven” vs. “consultants driven”

• Extremely proprietary solutions

• Proprietary extensions to standards

No standard or clause in a standard has a divine right of existenceNo standard or clause in a standard has a divine right of existence-- -- A Microsoft PKI architect explaining Microsoft's position on standards compliance.A Microsoft PKI architect explaining Microsoft's position on standards compliance.

Page 18: Do We Need Esb Any More

What’s wrong with ESB?

• Focused on Vendor Background• Application Servers Vendors base their ESB on their

Application Servers

• EAI Vendors base ESB on their EAI

• Messaging Vendors base ESB on Message Brokers

• Some solutions became ESB for one night...

The trouble is that things The trouble is that things nevernever get better, they just stay the same, only more so. get better, they just stay the same, only more so.-- Terry Pratchett, "Eric" -- Terry Pratchett, "Eric"

Page 19: Do We Need Esb Any More

Steve Vinoski, chief engineer of product innovation for IONA

Frankly, if I were an enterprise architect today, and I Frankly, if I were an enterprise architect today, and I were genuinely concerned about development costs, were genuinely concerned about development costs,

agility, and extensibility, I’d be looking to solve agility, and extensibility, I’d be looking to solve everything I possibly could with dynamic languages everything I possibly could with dynamic languages and REST, and specifically the HTTP variety of REST. and REST, and specifically the HTTP variety of REST. I’d avoid ESBs and the typical enterprise middleware I’d avoid ESBs and the typical enterprise middleware

frameworks unless I had a problem that really frameworks unless I had a problem that really required them (see below). I’d also try to totally required them (see below). I’d also try to totally

avoid SOAP and WS-*.avoid SOAP and WS-*.

What’s wrong with ESB?

Page 20: Do We Need Esb Any More

The ESB check list• Contract first development• What does this mean

• Why it’s important?

• Agility• Test Driven Development

• Contiguous Integration

• “Mockability”

Page 21: Do We Need Esb Any More

The ESB check list• Standard compliance• WS-* standards compliance (beware of Vendor’s bias!)

• Interoperability

• WS Stack standard compliance

• Flexibility• REST

• SOAP

• Sound Community

Page 22: Do We Need Esb Any More

My opinions may have changed, but not the fact that I am right.My opinions may have changed, but not the fact that I am right. -- Ashleigh Brilliant -- Ashleigh Brilliant

CXF the ESB framework

Page 23: Do We Need Esb Any More

What's CXF

• IONA Celtix + Codehouse XFire = CXF

Celtix Celtix isis an Open Source, Java an Open Source, Java Enterprise Service BusEnterprise Service Bus and hosted in the ObjectWeb community.and hosted in the ObjectWeb community.

-- http://www.iona.com, in 2006

While Celtix has traditionally called itself an ESB, if you While Celtix has traditionally called itself an ESB, if you look at the code you'll see that Celtix has primarily look at the code you'll see that Celtix has primarily

focused on providing JAX-WS and WS-* support. The focused on providing JAX-WS and WS-* support. The new project will new project will NOTNOT be branded as an be branded as an ESBESB..

-- http://xfire.codehaus.org/XFire+and+Celtix+Merge

Page 24: Do We Need Esb Any More

What’s CXF?• JAX-WS certified stack

• Commercially Supported IONA

• Embeddable stack

• J2EE containers (BEA WLS, JBoss, IBM WebSphere, Tomcat, Oracle iAS, Apache Geronimo etc. )

• JBI (Apache Service Mix)

• Standalone Spring Container

Page 25: Do We Need Esb Any More

What’s CXF?● WS-* compliant stack

● WS-Addressing,

● WS-Policy,

● WS-ReliableMessaging

● WS-Security

● Fully integrated with Spring● REST enabled framework through

JAX-RS and HTTP binding

Page 26: Do We Need Esb Any More

CXF architecture

Messaging / InterceptorsMessaging / Interceptors

BusBus

Front-endsFront-ends

JAX-WSJAX-WS SimpleSimple

BindingsBindings

JAXBJAXB

AegisAegis

TransportsTransports

JMSJMS

HTTPHTTP

LocalLocal

Page 27: Do We Need Esb Any More

JAX-WS Architecture

ToolingTooling

JAX-WSJAX-WS

JAXB 2JAXB 2 SAAJSAAJ

•JAX-WS – Java API for XML WS• JSR 224 (java.xml.soap)• Web Services metadata JSR 170 (java.jws)• ••

•JAXB Java XML Binding API• JSR 222 (java.xml.bind)• • ••

•Tooling•WSDL to Java•Java to WSDL•etc...• • ••

•SAAJ•SOAP with Attachments API for Java• • ••

Page 28: Do We Need Esb Any More

CXF ArchitectureHow does CXF fit into ESB landscape?

Routing and mediationRouting and mediation

WS StackWS Stack Adapters/ConnectorsAdapters/Connectors

Messaging BackboneMessaging BackboneMessaging BackboneMessaging BackboneMessaging BackboneMessaging Backbone

CXFCXF

Page 29: Do We Need Esb Any More

Seeing is believingSeeing is believing-- American Proverb -- American Proverb

Exposing Services

Page 30: Do We Need Esb Any More

Hello World, CXF Way...

Page 31: Do We Need Esb Any More

Hello World, CXF Way...

Page 32: Do We Need Esb Any More

Hello World, CXF Way

• Look Ma! no XML, no generated artefacts!

• POJO service

• Dead simple! Even Your Grandma’ can do it!

• Up and running - in just 19 lines of code!

Page 33: Do We Need Esb Any More

What’s Wrong with this Example?

• It’s not contract first

• It’s just remoting

• It runs in built-in HTTP container

Page 34: Do We Need Esb Any More

Real-world CXF WebservicesShipIt Inc. - Shipping service The contract

Page 35: Do We Need Esb Any More

Real-world CXF WebservicesShipIt Inc. - Shipping service The contract

Page 36: Do We Need Esb Any More

Real-world CXF WebservicesGenerating the service model

Page 37: Do We Need Esb Any More

Real-world CXF WebservicesGenerated POJO model

Page 38: Do We Need Esb Any More

Real-world CXF WebservicesGenerated POJO model

Page 39: Do We Need Esb Any More

Real-world CXF WebservicesService Endpoint Interface

Page 40: Do We Need Esb Any More

Real-world CXF WebservicesImplementing the Endpoint

Page 41: Do We Need Esb Any More

Real-world CXF WebservicesWiring it all together, and deploying

Page 42: Do We Need Esb Any More

Real-world CXF Webservices

• What's wrong with this service?

• No value constructors

• No toString, hashCode and equals

● XMLGregorianCalendar?

● No validation

● No Security

Page 43: Do We Need Esb Any More

Real-world CXF Webservices

• Customizing JAXB binding via xjc plugins

• Jakarta Commons Plugin

• Value Constructor Plugin

● Simple Preserve Plugin

● Value Constructor Plugin

● More on:

● https://jaxb2-commons.dev.java.net/

Page 44: Do We Need Esb Any More

Real-world CXF Webservices• Getting rid of XMLGregorianCalendar

Page 45: Do We Need Esb Any More

Real-world CXF WebservicesAdding validation and security

Page 46: Do We Need Esb Any More

Real-world CXF WebservicesPutting it all together

Page 47: Do We Need Esb Any More

Real-world CXF WebservicesPutting it all together

Page 48: Do We Need Esb Any More

Real-world CXF WebservicesMonitoring and managing CXF● Built-in JMX monitoring and managing

module● Exposing custom components

Page 49: Do We Need Esb Any More

Real-world CXF Webservices● Monitoring and managing CXF

Page 50: Do We Need Esb Any More

There are only two tragedies in life: one is not getting what one There are only two tragedies in life: one is not getting what one wants, and the other is getting it.wants, and the other is getting it.

-- Oscar Wilde-- Oscar Wilde

Consuming Services

Page 51: Do We Need Esb Any More

Consuming Services• Generate Stubs from WSDL, as before

• Use generated Client Stub

• Disadvantages

• No CXF fine-tuning

• Bloated client

• No Spring integration

Page 52: Do We Need Esb Any More

Consuming WebservicesConsuming through CXF client API

The same in Spring

Page 53: Do We Need Esb Any More

There are only two tragedies in life: one is not getting what one There are only two tragedies in life: one is not getting what one wants, and the other is getting it.wants, and the other is getting it.

-- Oscar Wilde-- Oscar Wilde

Testing Services

Page 54: Do We Need Esb Any More

Testing services• Service implementation is just POJO

• Service can be exposed using Endpoint.publish and consumed as a standard endpoint

• Leads to problems with CI servers

• Services can be exposed through CXF convenient API, and through local:// (in VM) transport

Page 55: Do We Need Esb Any More

Real-world CXF WebservicesUnit testing CXF services

Page 56: Do We Need Esb Any More

Do we need ESB?• In complex scenarios... yes!

• But maybe You have one already?

• Check something that works for You

• Use ESB Check List when selecting concrete solution

• Try to avoid Vendor Lock-in

• Community is important!

Page 57: Do We Need Esb Any More

Questions?

Page 58: Do We Need Esb Any More

Dziękuję!