AustinJUG_ESB_Deep_Dive_v3

Download Report

Transcript AustinJUG_ESB_Deep_Dive_v3

Enterprise Service Bus
Deep, Deep Dive
Burr Sutter
October 2007
A Real World Scenario
ASCII
ASCII
File System
File System
Source
System
ASCII
MSG
Data
FTP
FTP
GET
MQ
Socket
JMS
Listener
SQL
TCP/IP
Socket
JDBC/ODBC
Select
Update
Questions: [email protected]
The ESB Solution
ASCII
ASCII
File System
File System
Source
System
Receiving
System 1
XML
JBoss ESB
JMS
Receiving
System 2
ASCII
ASCII
JMS
File System
FTP
XML
SOAP
Receiving
System N
Questions: [email protected]
Receiving
System 3
Enterprise Service Bus
Event Listeners and Actions
provide transport mediation
Transports
Pluggable Architecture
for integrating infrastructure services
runs within a container or
standalone
HTTP(S)
Business Service
Components
FTP
Infrastructure
Services
Java EE 5
File
ASCII
XML
Binary
Business Services
Transformation
Routing
Security
Management
Web Services
JCA
JMS
EJB
Seam
Email
ESB
POJOs
SQL
Drools
Hibernate
JCA/Inflow
Socket
Service
Registry
UDDI
Message
Store
Declarative
Orchestration
Engine
Event
Notification
Custom
Action
BPEL
jPDL
Spring
Groovy
Service Component Architecture
Service Data Object
SOAP
Excel
Browser
Process
Store
Business
Data
Web
Native
Java
Declarative Transformation includes:
Message Normalization,
Validation, Enrichment,
Via XSLT, Groovy, Java, StringTemplate
Questions: [email protected]
RDBMS
Legacy
COTS
ESBs Across The Enterprise
Business
Service
HTTP/S
Transformation
Routing
Security
Management
FTP
JSR 181 POJOs
File
JBoss ESB
EJB3
JMS
Invoicing/Order Entry
JCA
POJO
Email
Service
Registry
SOAP
Event
Store
Composition
Engine
Notification
Web
Seam
BPEL
jPDL
Scripting
Process
Store
Business
Data
Portal
Web Order Entry
Accounting
File
Routing
ESB
Composition
Engine
Process
Store
BPEL
Security
FTP
SOAP
Service
Registry
Shared
Distributed
Registry
File
JBoss ESB
Email
SOAP
Service
Registry
Plus Lightweight ESB
Architecture
Questions: [email protected]
Event
Store
Composition
Engine
BPEL
Notification
Process
Store
Service Federation
Warehouse Services
Shipping Calc
Shipping Calc
Shipping
Calc
Inventory
Check
Inventory Check
Inventory
Check
Inventory
Update
Inventory Update
Inventory Update
Order Services
Order Validation
Order Validation
Credit Check
Credit Check
Process Store
Routing Services
Registry
& Messaging
Customer Services
Rules Services Cluster
Customer Inquiry
Customer Inquiry
Customer Update
Customer Update
Accounting
Accounting
Transformation Services Cluster
* JVM
Questions: [email protected]
Enterprise Service Bus
Mid 2007
Event Listeners and Actions
provide transport mediation
Transports
Future
Partners
Pluggable Architecture
for integrating infrastructure services
runs within a container or
standalone
HTTP(S)
Business Service
Components
FTP
Infrastructure
Services
Java EE 5
File
ASCII
XML
Binary
Business Services
Transformation
Routing
Security
Management
Web Services
JCA
JMS
EJB
Seam
Email
ESB
POJOs
SQL
Drools
Hibernate
JCA/Inflow
Socket
Service
Registry
UDDI
Message
Store
Declarative
Orchestration
Engine
Event
Notification
Custom
Action
BPEL
jPDL
Spring
Groovy
Service Component Architecture
Service Data Object
SOAP
Excel
Browser
Process
Store
Business
Data
Web
Native
Java
Declarative Transformation includes:
Message Normalization,
Validation, Enrichment,
Via XSLT, Groovy, Java, StringTemplate
Questions: [email protected]
RDBMS
Legacy
COTS
Where’s the Logic?
•
•
•
•
•
As a scriptlet in your JSP
Behind your Swing Button Click Action Handler
In your Struts Action
In your DAOs
In your Stored Procedures
Questions: [email protected]
The Modern Silo
Browser
Web
App
DB
Pages: Struts, JSF, Tapestry
DAO/JPA/SLSB/Spring Bean
Hibernate
Query/Stored Procedure
Questions: [email protected]
Silos Across the Enterprise
Client
Client
Manufacturing
Accounting
Client
CRM
Ordering
Warehouse
Questions: [email protected]
Client
Integrating Silos (Dump & Load)
Client
Client
Web
5250
PHP
SOAP
RPG
ASCII
FTP
DUMP
ASCII
FTP
DB/2 400
MySQL
Accounting
FTP
Client
CRM
Ordering
Client
Warehouse
VisualBasic
Struts
VisualBasic
DAO
ASCII
Stored Proc
Oracle
SQL Server
ASCII
Questions: [email protected]
Manufacturing
Intermediate those Silos
Browser
Mediation
Rich
Service 1
Service 2
Service 4
DB
Legacy
Service 3
DAO/JPA/SLSB/Spring Bean
Hibernate
App
Mediation
B2B
Service 5
Service 6
Query/Stored Procedure
Questions: [email protected]
Splice Technique
Web Order Entry
Web Order Entry 2
Web
Web
JSF
Struts
Seam
Interceptors
AOP
queue
EJB3
Spring
queue
Hibernate
iBatis
Hibernate
Callback Listeners
Oracle
DB/2
JBoss ESB
Questions: [email protected]
Splice Demo
ESB Definition
•
There is NO J2EE-like specification with a TCK that can define
and validate an ESB like there is for App Servers.
• ESBs are categorized by their capabilities – some come from a
heritage of EAI and others of MOM.
• Capabilities:
–
–
–
–
–
–
–
–
–
Message delivery
Transport protocol mediation
Event capture
Intelligent routing
Orchestration
Transformation
BPM
Adapters
And much, much more…
Questions: [email protected]
JBossESB 4.2 provides
•
Message delivery
–
–
•
Action chaining/pipeline
–
•
BPM, Intelligent routing, EIPs and hot deployment
Registry
–
–
•
•
•
•
JBoss Rules, XPath DSL
Recipient List/Static Routing is also supported
Orchestration
–
•
XSLT, Java, Groovy, StringTemplate
Content-based routing
–
–
•
For custom service enablement & mediation
Transformation
–
•
JMS (JBossMQ, JBoss Messaging, ActiveMQ, MQSeries, Oracle AQ)
(S)FTP, SOAP, HTTP, email, database, shared file system
JAX-R based
UDDI support out-of-the-box (Scout and jUDDI)
Message Store
Gateways
Extensive examples and documentation
And more…
Questions: [email protected]
JBoss ESB 4.2
• JMX Microkernel
• Federated Clustering
• WS-*
•
•
•
•
•
•
•
– SOAP
•
– WSDL
•
– 181 Annotated POJO Endpoints
•
– EJB Endpoints
•
– JAXB 2.0
BPEL 2.0
•
New Deployment Architecture •
.esb Archive
•
Hot Deployable Core Services •
Content Based Filter
Business Rules Services
Native Process Orchestration
Hibernate Gateway/Listener
HTTP Gateway/Listener
Groovy Scripting
Declarative Message Store
JCA Container
Spring Action AOP & POJO
Monitoring & Mgmt Tools
Additional EIP examples
Questions: [email protected]
ESB Transformation Engine
•
•
•
•
•
•
Validation
Enrichment
Inline transformations (Fragment based Processing)
Profile based XML/non-XML processing
Anything to Anything (XML, CSV, binary, X12, POJO)
Mix/Match transformers on a single message:
– Java
– Groovy
– StringTemplate
– XSLT
• 4X performance boost over plain XSLT (Xalan):
http://milyn.codehaus.org/Chiba+Integration
Questions: [email protected]
jboss-esb.xml
• Configuration for one or more services which show
up in the registry.
• Deployed as the key element of a .esb archive in 4.2+
• Structure of a .esb archive
META-INF
jboss-esb.xml
com.mycompany.soa.mycustom.actions
MyCustomAction.class
Tip: Use one of the quickstarts as your template for your new project. We do
assume that you are comfortable with Ant. An Eclipse Project template is under
Development and will be available in SVN soon (as of May 16, 2007)
Questions: [email protected]
Hello World – jboss-esb.xml 1
<?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schema
s/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
<providers>
<jms-provider name="JBossMQ"
connection-factory="ConnectionFactory">
<jms-bus busid="quickstartGwChannel">
<jms-message-filter
dest-type="QUEUE"
dest-name="queue/quickstart_helloworld_Request_GW"/>
</jms-bus>
<jms-bus busid="quickstartEsbChannel">
<jms-message-filter
dest-type="QUEUE"
dest-name=" queue/quickstart_helloworld_Request_ESB"/>
</jms-bus>
</jms-provider>
</providers>
Questions: [email protected]
Hello World – jboss-esb.xml 2
<services>
<service
category="FirstServiceESB"
name="SimpleListener"
description="Hello World">
<listeners>
<jms-listener name="JMS-Gateway"
busidref="quickstartGwChannel"
maxThreads="1"
is-gateway="true"/>
<jms-listener name="helloWorld"
busidref="quickstartEsbChannel"
maxThreads="1"/>
</listeners>
<actions>
<action name="action1"
class="quickstart.helloworld.MyListenerAction"
process="displayMessage"/>
</actions>
</service>
</services>
</jbossesb>
Questions: [email protected]
Hello World - action
package org.jboss.soa.esb.samples.quickstart.helloworld;
import org.jboss.soa.esb.message.Message;
public class MyListenerAction
{
public Message displayMessage(Message message) {
System.out.println("Body: " + new
String(message.getBody().getContents()));
// modify the contents, do anything Java can do…
return message; // always return the message for the “chain”
}
public MyListenerAction(ConfigTree config) {
// this constructor will be used to handle any jboss-esb.xml
} // custom property configuration
}
Questions: [email protected]
Action Pipeline (in a Service)
Actions are reusable mediation components that can be chained
together to form the capabilities of a registered service. Actions
can be dynamically added/removed at runtime.
My_Registered_Service
FTP
Action
Action
Transformation
CSV to XML
Action
Routing
Splitter
or
BPM
Action
Logging
Audit
Trail
Action
Business
Logic
Invocation
Transformation
XML to POJO
This box can also represent the ESB’s JVM – actions are “in VM”
Questions: [email protected]
Business
Logic
Component
Business Logic:
• POJO
• EJB
• WS
• Rules
• JCA with Adapters
• Anything with Java API
Basic Service Demo
Enterprise Integration Patterns
File Transfer
Recipient List
Channel
Router/CBR
Message
Splitter
Message Filter
Aggregator
Message Store
Translator/Transformer
Enricher
Wire Tap
Process Manager
Content Filter
More information at
www.enterpriseintegrationpatterns.com
Questions: [email protected]
Routing, Services & Actions
A_Service
Action
SOAP
EJB
DB
B_Service
ASCII
XML
Binary
FTP
Action
Action
C_Service
JMS
POJO
DB
D_Service
Action
JMS
Action
Questions: [email protected]
WS
DB
Content Based Routing
Orders over 12K or from Platinum customers
Platinum_Service
Action
SOAP
Ordering_Service
Action
FTP
POJO
DB
ASCII
XML
Binary
Special_Handling
Action
SOAP
EJB
DB
Randomly grab orders for review – tracer and
Keep a total of all orders flowing through the system
Orders from customers in certain states/countries
Questions: [email protected]
Content Based Routing Engine
•
•
•
Currently based on JBoss Rules – supports XPATH DSL
Access to the complete Header and Body/Contents for evaluation
Zero to many destinations
rule "Routing Rule using XPATH Greater"
when
xpathGreaterThan "/Order/@totalAmount", "50.0"
then
Log : "Really It's EXPRESS Shipping";
Destination : “express";
end
rule "Routing Rule using XPATH Less"
when
xpathLessThan "/Order/@totalAmount", "50.0"
then
Log : "Really It's NORMAL Shipping";
Destination : “normal";
end
Destination is determined by the jboss-esb.xml
Questions: [email protected]
Splitter/Aggregator Quickstart
Also demonstrates, federated ESB, multi-JVM capabilities
Inbound Splitter
JMS
Action
Red
Action
JMS
Aggregator_Service
Green
Action
JMS
JMS
Blue
JMS
Action
Questions: [email protected]
Action
EIP Demo
Load Balancing & Fail-Over
The same discount_service.esb can be deployed to multiple ESB instances/nodes. Each one
is a new EPRs in the registry. The routing engine is clever enough to load-balance and failover between the various EPRs. Should no EPR be available, it will scheduled the message
for redelivery, waiting N seconds and retrying all possible EPRs found at that time.
Questions: [email protected]
Deployment Options
• 1) ESB “within” an Application Server – Users have existing
investments in the J2EE/Java EE App Servers and wish to run the
ESB as a set of components in that App Server.
– JBoss ESB can run “within” the JBoss Enterprise Application Platform 4.2
• 2) ESB “beside” an Application Server – Users wish to leave their
existing application server environments untouched but still add
mediation, SOA & integration capabilities.
– JBoss ESB has its own lightweight engine/container for the hosting
mediation services. It can run “beside” your existing middleware from
your vendor of choice.
• 3) ESB “standalone” in a J2SE environment – this option is primarily
for development & testing purposes, it is not recommended for
production as of the 4.2 release.
Questions: [email protected]
Management & Monitoring
• 4.2 Release is focused on JMX instrumentation, the
ability to monitor the health and load of every distributed
service as well as start, stop & restart them remotely.
Questions: [email protected]
Management & Monitoring Architecture
Questions: [email protected]
Orchestration
Orchestration (Got Flow)
Simple Order Handling Process
Customer
Submit Order
Customer
Service
Receive Order
Credit
Agency
Warehouse
Issues
Validate Order
CSR Teams
Credit Check
Inventory Check
Shipper
Send Shipment
Handle Shipment
Customers submit orders via web browser, FTP and Web Services.
The system receives and validates the order, errors are sent to the appropriate CSR Team
A credit check request is made, any areas of concern are sent to the appropriate CSR Team
An inventory check request across multiple warehouses is sent, lack of availability goes to the CSRs.
Assuming the order is valid, checks credit and available inventory, pick tickets are printed, shipping
labels are printed, someone throws the parts into a crate or places on a pallet and puts the package
by the loading dock. Various shipping companies are employed.
Questions: [email protected]
Service Oriented Orchestration
Customer
Submit Order
Customer
Service
Receive Order
Issues
Validate Order
Credit
Agency
CSR Teams
Credit Check
Inventory Check
Warehouse
Shipper
Send Shipment
Handle Shipment
Validate Order
Credit Check
a Parse XML
b Transform
c Apply Business Rules
a Create Outbound Msg
b Handle Response
c Apply Business Rules
Inventory Check
ESB Mediates
& Provides Services
a Send to N Warehouses
b Handle N Responses
c Determine Best WHSEs
d Handle Drop-Ships
Questions: [email protected]
Send Shipment
a Determine Shipper(s)
b Print Labels
c Print Pick Tickets
d Create & Send ASNs
Service Orchestration & BPM
Humans
Customer
CSR
Sales Mgmt
WHSE Mgmt
Submit Order
FTP
Receive Order
Issues
Validate Order
CSR Teams
Credit Check
SOAP
Inventory Check
Send Shipment
Handle Shipment
File
Validate
Order
Credit
Check
Inventory
Check
Send
Shipment
…
Various Transports
External
J2EE App
Server
Credit/Bank
Legacy
Partners
An ESB Service is visible in the UDDI registry automatically. A single ESB Service may or may
not expose a WSDL. It may use out-of-the-box actions, custom actions and/or consume external
services from various sources. Focus on the reuse of existing infrastructure and assets.
Questions: [email protected]
Orchestrated/Composed Services
JVM
BPM
External
Actor
Validation_Service
DAO
DB
Action
POJO
DB
Action
EJB
DB
Action
External
Actor
External
Actor
Pricing_Service
Order_Service
Action
Questions: [email protected]
Orchestration Designer
Questions: [email protected]
Orchestration Demo
Questions?