Você está na página 1de 57

SOA Using OpenESB,

BPEL and NetBeans

Sridhar Reddy
Technology Evangelist
Sun Microsystems, Inc.
[1]1
Goal
Learn how to build reusable
services and orchestrate them as a
Composite Service using Open
SOA Platform

[2]
Agenda
• Services And Composite Applications
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[3]
Agenda
• Services / Composite Applications
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[4]
Wikipedia definition of Service
• A well known term
• In the context of Enterprise architecture, Service-
orientation, and Service-oriented architecture, the
term service refers to a discretely defined set of
contiguous and autonomous business or technical
functionality
• OASIS (organization) defines service as "a
mechanism to enable access to one or more
capabilities, where the access is provided using a
prescribed interface and is exercised consistent
with constraints and policies as specified by the
service description
[5]
SOA
• Service oriented Architecture; It is a software
architectural style for creating and using
business processes, packaged as services
• SOA separates functions into distinct units
(services), which can be distributed over a
network and can be combined and reused to
create business applications. These services
communicate with each other by passing data
from one service to another, or by coordinating
an activity between two or more services

[reference wikipedia]
[6]
Web Service
• No single definition could nail down what a
Web service is!
• Generally speaking, it is an industry pattern
where remote services are accessed using
protocols HTTP & SOAP and using the
interface definition language WSDL

[7]
Traditional Application Development
• Point technologies, products, and APIs
> For example: EJB, Spring, Hibernate, JSF,
Servlets, Struts, etc.
• Lots of glue written by developers to integrate
and make these services reusable
> Inflexible, since their designs didn't account for it
> At best, requires a great deal of expertise & time

[8]
Composite Applications
• A way to compose applications from
reusable parts
• Composite applications employ SOA
principles
> Features exposed as Web services
> Standards-based interaction between
services
> Are themselves composable

[9]
Are Services always Web services ?
• No there are a lot of different software
services. Services are implemented in one
or more of the following ways
> Enterprise JavaBeans™ (EJB™) technology
> BPEL, XSLT, SQL
> Business rules
> Mainframe transaction
> EDI transform
> Humans (yes, really!)
>…
• Although web services paradigm seem to
have caught on a lot in the industry [10]
So, a Web services Stack Sufficient ?

• May be, if all services have Web services


endpoints
• In order to create a Composite Service
that includes non-web service based
service the following are needed
> An Orchestration tool (BPEL)
> An Open Standard (JBI)
> An Open Platform(Open ESB)

[11]
Composition of Services
Airline Car
Reservation Reservation

Airline ? Airline Car


Incomeplete Reserved Car ? Reserved
Itinary Timeout Timeout
Cancel Cancel

Hotel
Complete Reserved
Itiniary Timeout Hotel ?
Cancel

Hotel
Reservation
[12]
Agenda
• Composite Applications / Services
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[13]
SOA
• To achieve the goals of SOA, we must
have the capability of
> Composing services
> Exposing these services
> Clubbing services; one or more services are
used together
> Coordination of services; few services may
interact with each other in a bigger
composite service
> Orchestration of services
• In the rest of the presentation we will see
how we can achieve that!
[14]
Agenda
• Composite Applications / Services
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• GlassFish ESB .next

[15]
Business Process Execution Language
• SOA needs a tool (language) that helps in
> Composition of services: Developers should be able to
implement a defined service.
> Coordination of services: Developers should have the easy
capability to coordinate different services.
> Orchestration of services: Developers need easy mechanisms to
implement the orchestration of their composed services,
> For composing synchronous and/or asynchronous services.
> For Error handling
> For Compensation
> Other general programming constructs: SOA implementation
tools also need advanced level of programming capabilities
> Concurrent execution
> Conditional repeated executions
> Decision gates and so on.
[16]
Why BPEL?
• All the capabilities we just talked about are provided by
BPEL.
• BPEL is a Oasis standard backed by industry leaders
• BPEL is based on WSDL specification
• BPEL is a declarative language.

[17]
Business Process does...
• Coordinate asynchronous • Manipulate/transfor
communication between m data between
services
partner interactions
• Correlate message
exchanges between • universal data
parties model for message
• Support for long running exchange
business activities

[18]
Business Process does...
• Implement parallel • Exception handling
processing of • Implement
activities compensation logic
• Implement (Undo operations)
asynchronous event
handling
• Implement concurrent
event handling
• Implement event
handling with
timeouts
[19]
BPEL Document Structure
<process>
<!– Definition and roles of process participants -->
<partnerLinks> ... </partnerLinks>
<!- Data/state used within the process -->
<variables> ... </variables>
<!- Properties that enable conversations -->
<correlationSets> ... </correlationSets>
<!- Exception handling -->
<faultHandlers> ... </faultHandlers>
<!- Error recovery – undoing actions -->
<compensationHandlers> ... </compensationHandlers>
<!- Concurrent events with process itself -->
<eventHandlers> ... </eventHandlers>
<!- Business process flow -->
(activities)*
</process>

[20]
BPEL Activities
Basic Activities Structured Activities
• <invoke> • <if>
• <receive> • <while>
• <reply> • <repeatUntil>
• <assign> • <foreach>
• <throw> • <pick>
• <wait> • <flow>
• <empty> • <sequence>
• <exit> • <scope>

[21]
BPEL: Basic Activities
• <invoke>
> To invoke a one-way or request/response
operation on a portType offered by a partner
• <receive>
> To do a blocking wait for a matching message to
arrive
> Can be the instantiator of the business process
• <reply>
> To send a message in reply to a message that was
received through a <receive>
> The combination of a <receive> and a <reply>
forms a request-response operation on the WSDL
portType for the process [22]
BPEL: Structured Activities

• <sequence>
> Perform activities in sequential order
• <flow>
> Perform activities in parallel
• <if>
> Conditional choice of activities
• <scope>
> Enclose multiple activities in a single scope

[23]
Example Business Process

Receive <PO> <sequence>

Invoke <InventoryService> Invoke <CreditService> <flow>

Reply <Invoice> </sequence>

[24]
Sample Activities in BPEL
<sequence>
<receive partnerLink=“customer” portType=“lns:purchaseOrderPT"
operation=“sendPurchaseOrder” variable=“PO”
createInstance="yes" />
<flow>
<invoke partnerLink=“inventoryChecker” portType=“lns:inventoryPT”
operation="checkINV" inputVariable="inventoryRequest"
outputVariable="inventoryResponse" />

<invoke partnerLink="creditChecker" portType=“lns:creditPT"


operation="checkCRED" inputVariable="creditRequest"
outputVariable="creditResponse" />
</flow>
...
<reply partnerLink=“customer” portType=“lns:purchaseOrderPT”
operation=“sendPurchaseOrder” variable=“invoice"/>
</sequence>

[25]
BPEL: Relationship to Partners

WSDL
Partner Service

Partner Service

Partner Service
Orchestrating Process
(BPEL) Partner Service

[26]
BPEL Contd..
• BPEL is key to implementing SOA
> Conversational
> Mostly Async
> XML Document-based
> Orchestrated
• It is no wonder that BPEL has become the language of
choice for SOA.

[27]
Agenda
• Composite Applications / Services
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[28]
Loan Processing Demo –
Using BPEL orchestration and
Open ESB components

[29]
Introduction Contd.
Home loan approval process

Approval process
User sends loan receives message
application form Credit check service
Credit check
process receives
Invokes credit
message
check service

Responds with
information of credit
worthiness

Invokes home Home appraisal service


appraisal service Home appraisal
process
receives message
Receives price
evaluation
service response
Asynchronously
responds the result
of price evaluation
Qualifies for loan?

Invoke loan
File write approval
response service

[30]
Demo Introduction
• “Client” sends loan application to Loan
Service
• Loan Service checks the credit worthiness
of the applicant by calling Credit Check
Service
• Loan Service then calls Home Appraisal
Service to appraise the home price
• If both Credit Check Service and Home
Appraisal Service, send an approval, Loan
Service approves the loan and sends a
message for the Client
[31]
• Creating the Credit
Credit check service Check Service
• Uses Synchronous
Credit check service
request-reply
pattern
Credit check
process receives
message
> Dotted line
represents the
synchronous
Responds with
information of credit
worthiness
response
• Responds with a
Approved or
Denied message
based on contents
of the request
[32]
Home appraisal service
• Creating Home
Home appraisal service
Appraisal Service
Home appraisal
• Uses
process
receives message Asynchronous
request-reply
pattern.
Asynchronously
responds the result • Enhancing the
Loan Service to call
of price evaluation

the Home Appraisal


Service.

[33]
Loan Approval service
Home loan approval process
• Creating a simple
Approval process
receives message version of Loan
Service
Invokes credit
check service • Accepts request
Invokes home
from client
appraisal service
• Employs the Credit
Receives price
evaluation Check Service
• Responds to the
service response

Qualifies for loan? client by writing the


Invoke loan
loan approval or
approval
response service denial message to
a file
[34]
Summary – putting it all together
Home loan approval process
Approval process
User sends loan receives message Credit check service
application form
Credit check process
receives message
Invokes credit
check service
Responds with
information of credit
worthiness

Invokes home Home appraisal service


appraisal service
Home appraisal
process
Receives price receives message
evaluation
service response
Asynchronously
responds the result
Qualifies for loan? of price evaluation

Invoke loan
File write approval
response service

[35]
Demo now..
• Lets dig into the code, tools, runtimes

• LAB-5510:
> Orchestration of Web Services using WS-BPEL

[36]
Agenda
• Composite Applications / Services
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[37]
Java Business Integration (JBI)
• We talked about how BPEL fits into the building blocks of
SOA. What about exposing of services and the details of
invoking other services
• Services can be exposed via different protocols which
immediately means
> System needs to be able to receive messages on a
whole slew of protocols
> System needs to be able to invoke on a whole slew of
protocols
• It is a good architecture to separate out the service from
the details of how it may be exposed now or in future.
• We will see how JBI fits in here.

[38]
What Is JBI?
• Java Business Integration
• Standard “meta-container” for
integrated services
• Provides for plug-in:
> Service Engines (SE): business
logic
> Binding Components:
communications protocols
• Standard deployment model
• Loose coupling via WSDL
message exchanges between
WSDL described Services

[39]
Various services and protocols
Orchestration Transformation
J2EE Platform
(BPEL) (XSLT)
WSDL WSDL WSDL

Management
System
JBI
Normalized Message Router Core
Services

WSDL WSDL WSDL

WS-I Basic AS2 JMS


SOAP
J2EE Platform
[40]
Service Provider Self Description
Components register the
services they provide
Orchestration Transformation
J2EE Platform
(BPEL) (XSLT)
WSDL WSDL WSDL

Management
System
JBI
Normalized Message Router Core
Services

WSDL WSDL WSDL

WS-I Basic AS2 JMS


SOAP
J2EE Platform

[41]
Agenda
• Composite Applications / Services
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[42]
What is Open ESB?
• Project Open ESB provides an Enterprise
Service Bus (ESB) runtime using Java
Business Integration as the foundation
> This allows easy integration of web services
to create loosely coupled enterprise class
composite applications.
• It also provides various tools for the
development, deployment, and management
of composite applications

[43]
Open ESB Architecture

[44]
Open ESB Components
Binding Comps Other
Service Engines > MQSeries BC > Clustering
> BPEL SE
> HL7 BC > CASA
> XSLT SE
> SAP BC > JBI Mock
> JavaEE SE
> SMTP BC > WSIT Tech
> IEP SE
> HTTP BC
> ETL SE In Progress
> JMS BC
> SQL SE > CAM
> File BC
> Workflow SE > Aspect SE
> CICS BC
> Encoding SE
> DCOM BC
> Rules SE
> CORBA BC
> Scripting SE
> ... [45]
Open Source Projects for SOA on java.net
> Open ESB
> Umbrella Project for all Open ESB Projects (
http://open-esb.org/)
> Contains Web Applications, JBI Core runtime, Multi App
Server support
> Open JBI Components
> Sub Project of Open ESB
> Contains all the JBI compliant components
> So far contains about 40 components; more are being added
> Although Sun is a major contributor, many others are
contributing quite a bit – about 12 or so are non-Sun
contribution
> Project Mural
> Project to develop community-driven solutions for master data
management (https://mural.dev.java.net/). [46]
Project Open ESB
Over 600 members and 600,000
downloads

Best SOA tools via Netbeans

CDDL license – Free to download


and free to deploy

Close to 40 components

http://open-esb.org

[47]
Agenda
• Composite Applications / Services
• Building Blocks of SOA
> BPEL
> SOA Demo
> JBI
> Open ESB
• What NEXT

[48]
Introducing Project Fuji – Do more with Less
• Bigger standards – OSGi, JBI, WS- *, Java EE
• More Flexibility – languages, tooling, deployment env
• More Choices – Modular, get what you want
• Interoperability between OSGi and JBI based services
• Less code – less framework and plumbing code.
Configuration Vs coding
• Loose Coupling – Pluggable architecture
http://fuji.dev.java.net/
• Inherently scalable

[49]
Introducing Open ESB V3
• Core runtime – Fuji
• Continuum of strength of Open ESB V2
> Moving forward the vibrant ecosystem of
Open ESB V2
• Container Neutral ESB
> Deploy on any OSGi compliant
container., aka GlassFish V3
• Driven by YOU - COMMUNITY
http://open-esb.org

[50]
Introducing GlassFish ESB
http://glassfishesb.org
• GlassFish ESB =
Open ESB +
GlassFish + ...
• Lightweight and
agile ESB for
GlassFish

[51]
Getting Involved
> Visit - http://glassfihesb.org, http://fuji.dev.java.net, http://open-esb.org
> Easy to join
> Sign a Contributor Agreement and join many of the efforts at Open
ESB
> Check out forums and aliases at
> http://open-esb.org
> https://open-jbi-components.dev.java.net/
> Partners or contributors may get featured on open-esb.org site.
> https://open-esb.dev.java.net/Partners.html
> https://open-esb.dev.java.net/CommunityPartnerDirectory.html
> Download
> https://open-esb.dev.java.net/Downloads_OpenESB_Addons_NB6.html
> Components Documentation, demos,...
> https://open-esb.dev.java.net/Components.html
> Components Source code
[52]
Mural
GlassFish ESB - Data Services for SOA and Web
- Service-Oriented integration 2.0
platform - Open Source face of
- Lightweight and flexible Master Data Management
- Built on open standards - OSGi, JBI - Single View of data from multiple
- Loosely coupled, inherently scalable sources
http://glassfishesb.org http://mural.dev.java.net

COMMUNITY CONTRIBUTION 'GlassFish ESB' and Mural

Open Source Portal

Business Activity Monitoring


MURAL COMPLEX EVENT PROCESSING | BUSINESS DASHBOARDS
OPEN ESB
Project Metro Master Data Management
Single Entity View | Data Integration | Data Quality | Master Index
OPEN DS
Business Process Management
ORCHESTRATION
NETBEANS
GLASSFISH Enterprise Service Bus
PLUGGABLE | MEDIATION | ADAPTERS | ROUTING | TRANSFORMATION

MESSAGE
Infrastructure
APPLICATION DIRECTORY SINGLE
SERVER | SERVER | SERVER | SIGN-ON
[53]
GlassFish ESB, Project Fuji, Open ESB v3
● Introducing Project Fuji, a lightweight SOA runtime that
can be deployed on any OSGi complaint container
● Project Open ESB V3 – Container-neutral ESB,
continuation of Open ESB V2 and much more that
leverages Project Fuji
● Introducing GlassFish ESB, the next generation
lightweight, agile, flexible SOA platform
> Fuji – core runtime
> Open ESB V3 + GlassFish – Production Supported ESB
platform
> Preview is available for download at
http://www.glassfishesb.org

[54]
Resources:
• http://glassfihesb.org
• http://fuji.dev.java.net
• http://open-esb.org
• Check out forums and aliases at
> http://open-esb.org
> https://open-jbi-components.dev.java.net/
• Partners or contributors may get featured on open-
esb.org site.
> https://open-esb.dev.java.net/Partners.html
> https://open-esb.dev.java.net/CommunityPartnerDirectory.html
• http://www.netbeans.org/kb/trails/soa.html
• http://developers.sun.com/learning/javaoneonline [55]
SOA Using OpenESB,
BPEL and NetBeans

Sridhar Reddy
Sridhar.Reddy@sun.com
Sun Microsystems, Inc.
56
[56]
Sessions and Activities at JavaOne
• Hands on Labs
> LAB 5530 - Building Secure, Reliable, Transactional SOA
Applications Using Open ESB, Tue, 6PM- 7.30PM
> LAB 5540LT - Query Continuous Data streams Using OpenESB's
Intelligent Event Processor, Wed, 9.30AM to 11.30AM
> LAB 5500 - Dynamic Service Composition with OpenESB:
Compose a JavaOne℠ Conference Survey/Poll Application,
Analyze Live Data, and Generate Real-Time Poll Reports, Thu,
2.50PM to 4.50PM
> LAB 5510 - Orchestration of Web Services, Using WS-BPEL, Fri
10.50AM to 12.50PM
> BOFs
> BOF 6586 - Java™ Business Integration 2.0, Wed, 6.30-7.20PM
> BOF 6211 - Transactions and Java™ Business Integration (JBI):
More Than Java Message Service (JMS), Wed, 7.30 - 8.20PM
[57]

Você também pode gostar