View
10.693
Download
1
Tags:
Embed Size (px)
Citation preview
<Insert Picture Here>
Oracle Service Bus 11g new features for the integration developers
Dmitry Nefedkin
ISV Migration Center FMW Technical Consultant
2
ISV Migration Center Team
• Who we Are ISV Migration Center Team is a team of senior technical consultants based in
Eastern and Central Europe and represents Oracle's technical investment for partners.
• Mission Statement Enable partners to rapidly and successfully adopt and implement Oracle
latest technology
• What do we Offer Whether you are selling Oracle technology, building business solutions,
including hosted Internet solutions or providing system integration and implementation services
for Oracle technology, IMC Team can help you succeed.
• How can we assist We offer a wide range of free services for partners such as one2one
assistance, webinars, seminars and hands-on workshops.
Our blog: http://blogs.oracle.com/imc
Contacts:
Ruxandra Radulescu, ISV Migration Center Manager EE&CIS, [email protected]
3
<Insert Picture Here>
Agenda
• Product Overview, Key features and benefits
• OSB 11g new features
– Service result caching
– JCA Transport Enhancement
– Custom XPath functions
– Transactional Message Flows
– Native java support
• Additional information & resources
4
Product Overview, Key features
and benefits
5
Oracle Service BusKey Ingredients for Enterprise Service Bus
Unified Security
FTPMQ
Adaptive Messaging
SMTP
Metadata
ReportingSLA Alerts
Content Based Routing
Transformation
Import / Export
Validation
Service Management
Service Virtualization Configuration
Framework
HTTP/S JCA JMS File
Change Center
Monitoring
WSRM Tux EJB
Service Chaining
REST
Authentication Authorization Identity Sign/Encrypt
JDBCAQSAPEBSPSFTJDESBL
6
Why a Service Bus? A few examples…
6
• The Point-to-Point problem
Service
Service
Service
Service
Application
Application
Application
Service
Service
Database
EJB
SAP
7
Why a Service Bus? Example: Location Transparency
7
• Isolate from changes to service location
Host One
New Hire Process
Initialize Benefits Service
Initialize Benefits Service
Host Two
Service Bus
Route to Host Two
AfterMove
Before
8
Why a Service Bus? Example: Backwards Compatibility
8
• Isolate from changes to service contract/interface
Service BusProcessOrder
Service
Customer Portal Transform
Message
<2.0>
<1.0>
CSR App<2.0>
<2.0>
<1.0>
9
Why a Service Bus? Example: Service Enablement
9
• Allow multiple protocols/messages to participate in a SOA
Service Bus
Transform Payroll ServiceJMSExpense
Reimbursement Process
SOAP
Submit Expense Report Service
FTP
Transform Check Order Status Service
SOAPInventory Management App JMS
10
Enabling Agility…With an Enterprise-Class Service Bus
10
• High-speed Intermediary
• Connect once; loosely coupled
• Promote service re-use
• Unlimited scalability
• Visibility into messages
• Benefits of Agility
• Adapt to change
• Improve re-use
• Manage risk
Oracle Service Bus
ServiceService ServiceService
ServiceService ServiceService
11
Oracle Service BusKey Differentiators
11
• Ability to work with services without WSDL
– Any Protocol <-> Any Payload
• Java integration
– POJO
– EJBs
• Endpoint Management
– Service Pooling, Throttling
• Advanced Mediation Patterns
– Split/Join (Chaining), Dynamic Dispatch
• Performance & Scalability
– 1000s of services
• Change management with zero down-time
– Semantic integrity and dependency checking
• Built-in management, monitoring and reporting
12
OSB 11g new features –
Service result caching
13
Service Result Caching - Overview
• Problem
– External service is invoked every time for results that may be reasonably static
• Eg. Product details, discount info
• Solution
– Service Result Caching
• Benefits
– Faster response times to clients/users
– Reduce load on potentially slow (legacy) backend systems
– Cache data is always consistent and available
– Operational ease in managing cache capacity
13
Process Flow /
Orchestration
Legacy
Service
Consumer
Service
Provider Ora
cle
Serv
ice B
us
14
Service Result Caching - Overview
14
Process Flow /
Orchestration
Legacy
Service
Consumer
Service
Provider
P
BBackup Node
PrimaryNodeGet / Put (Cachekey)
Service Data
Coherence Data Grid
OSB
Result
Cache
Ora
cle
Serv
ice B
us
Check cache
If results not in cache, invoke service & cache results
Side Cache Pattern
15
Service Result Caching – Feature Highlights
15
• Uses Oracle Coherence
– “Oracle Coherence is an in-memory data grid solution that enables
organizations to predictably scale mission-critical applications by
providing fast access to frequently used data.”
– User MUST install Oracle Coherence when installing Weblogic
Server to use Service Result Caching
• Single cache for ALL business services
• Only valid/correct results from Business Services cached
– Errors are NOT cached
16
Service Result Caching – Feature HighlightsKey Concepts
16
• Coherence Cache is like java.util.Map
– Key + Value
– Entries can have a limited lifetime
• Cache Key
– Service Ref + Operation + Cache Token
• Cache Value
– Result from invoking Business Service
• Cache TTL
– How long the result is kept in the cache
17
Service Result Caching – Feature HighlightsKey Concepts
17
• Cache Token
– Used to correlate request messages with cached values
– Can be generated based on request message
– Can also be set in the pipeline
• $outbound/ctx:request/ctx:cache-token
– eg. purchaseOrderId
• Cache TTL
– Can be generated based on request or response message
– Can be set in the pipelne
• $outbound/ctx:request/ctx:cache-ttl
– Default is 5 minutes
<0 0 >0
Not
cached
No expiry Expiry
time
18
Service Result Caching – Feature HighlightsBusiness Service - Configuration Details
18
How to calculate the Cache Token
How long the cached result will be kept for
19
Service Result Caching – Feature HighlightsGlobal Settings
19
20
Service Result Caching – Feature HighlightsBusiness Service - Operational Settings
20
21
Service Result Caching – Feature HighlightsDashboard - Service Health
21
How often the cache is hit compared to the total number of calls
How often the cache is hit
How often the external
service is invoked
22
Result caching demo
23
Result Caching Demo
23
RequisitionRequestor
(Proxy Service)
RequisitionRequestor
(Business Service)
Legacy
Routes to RequisitionRequestor (Business Service)
• Message has a requisition id
Caching is configured as follows:
• Cache Token is the requisition id
• Expiration Time is 1 minute
Represented in the demo by
the RequisitionProvider (ProxyService) which
• Waits 5 seconds (to simulate a slow legacy system)
• Returns a requisition for the given requisition id
24
OSB 11g new features –
JCA Transport Enhancement
25
JCA Transport Enhancement - Feature Highlights
25
Support for new 11g JCA adapter artifacts
- 10g JCA WSDL is no longer supported
- Support 11g JCA artifacts created in JDeveloper with SOA
plugin 11.1.1.3 or later:
JCA file, abstract WSDL, Schema, EclipseLink Mapping File
- Support both EclipseLink and TopLink mapping file
26
JCA Transport Enhancement - Feature Highlights
26
• New OSB resource
type jca for JCA Files
- JCA resource stores
JCA files
- JCA resource has
dependency on WSDL
- JCA resource might
have dependency on
TopLink Mapping file
27
JCA Transport Enhancement - Feature Highlights
27
• New XML resource type for
TopLink Mapping File
- We have introduced a new
resource type XML for storing
TopLink Mapping Files.
- TopLink Mapping File is no
longer stored in JCA transport
endpoint
- JCA resource may have
dependency on TopLink
Mapping File XML resource
28
JCA Transport Enhancement - Feature Highlights
28
• Improved user experience for creating JCA service in OSB console
- User no longer have to walk through the conventional service creation wizard to
create JCA proxy/business service
- A resource action button is provided for each JCA resource for creating JCA
proxy/business service and a concrete WSDL.
• Improved user experience for creating JCA service in Eclipse IDE
- Right click menu on JCA file provides link for generating JCA service
29
JCA Transport Enhancement - Feature Highlights
29
• OSB JCA Resource Dependency Hierarchy
JCA Service
Concrete WSDL
Abstract WSDL
JCA Resource
TopLink Mapping Resource
XSD/Schema
30
JCA Transport Enhancement - Feature Highlights
30
• Support for Normalized Message Properties via Transport Headers
- Normalized Message Properties for SOA JCA adapters are represented by JCA transport headers in OSB.
- Inbound Normalized Message Properties are converted to transport headers by JCA proxy service
- Transport headers are converted to Normalized Message Properties during JCA business service invocation
31
JCA Transport Enhancement - Feature Highlights
31
• Added new adapter certification for File and BAM
- OSB 11g certified File and BAM adapter in addition to DB, AQ,
OracleApps, SAP, PeopleSoft, Siebel, JDE adapters.
• Seamless upgrade for 10g JCA artifacts to 11g- When importing OSB config jar with 10g JCA artifacts, there will be
automatic upgrade for JCA artifacts from 10g to 11g.
- JCA WSDL will be upgraded to JCA file, abstract WSDL, and concrete
WSDL.
- JCA proxy and business service will be upgraded to 11g JCA service
and EclipseLink Mapping File XML resource.
32
JCA Transport Demo
33
OSB 11g new features –
Custom XPath functions
34
Custom XPath functions - overview
34
• The goal: Give customers the ability to extend the set of standard functions
used in XQuery expressions and XQuery/XSLT resources with their own
implementations, written in Java.
• The rationale: Certain transformations are too complicated or too inefficient
to be done with XQuery/XSLT language. For example, reuse utility complex
transformation functions already existing in java or even to do something with
a database or some external system.
OSB XQuery
Expression / resource
Oracle
XQuery 1.0 engine
XQ Standard functions
fn:concat
fn:abs
…
OSB built-in extensions
fn-bea:uuid
fn-bea:isUserInRole
…
Custom functions
ns0:myfunc
35
Custom XPath functions - Feature HighlightsTypical development process
35
– Write java code to implement function
– Compile and package up corresponding .class files in a jar file
– Put jar file in OSB xpath-functions directory (or server classpath)
– Add new .xml and .properties files into xpath-functions directory
– Restart OSB server(s)
– Voilà: you should be able to see and use the new functions in
XQuery expression editor
36
Custom XPath functions - Feature Highlights
36
At start-up, OSB reads the contents of ALSB_HOME\config\xpath-functions
directory and
– For each .XML file it finds, it goes through the list of functions in it and “registers”
them with XQuery engine.
– Each function gets an XQuery signature based on its Java signature
– For each .JAR file it finds, it will add it to classpath when evaluating results of
XQuery expressions
.properties
osb-built-in.xml
.properties
My-func.xml
%ALSB_HOME%\config\xpath-functions
directory
JAR File JAR File
OSB Runtime XQuery Engine
Added to OSB
classpath
register new functions …
37
Custom XPath functions - Feature HighlightsContents of configuration XML file
37
For each new function:
– Category id (key in .properties)
– (optional) Group id(key in .properties)
– Name
– Namespace
– Java signature
– Deterministic or not(always produces same
result for same arguments)
38
Custom XPath functions - Feature HighlightsContents of configuration XML file <?xml version="1.0" encoding="UTF-8"?>
<xpf:xpathFunctions xmlns:xpf="http://www.bea.com/wli/sb/xpath/config">
<xpf:category id="%CUSTOM_STRING_FUNC_CAT%">
<xpf:function>
<xpf:name>reverse</xpf:name>
<xpf:comment>%FUNC_REVERSE_COMMENT%</xpf:comment>
<xpf:namespaceURI>http://www.oracle.com/sample/osb/custom/StringUtils</xpf:namespaceURI>
<xpf:className>com.oracle.sample.osb.custom.StringUtils</xpf:className>
<xpf:method>java.lang.String reverse(java.lang.String)</xpf:method>
<xpf:isDeterministic>true</xpf:isDeterministic>
<xpf:scope>Pipeline</xpf:scope>
<xpf:scope>SplitJoin</xpf:scope>
</xpf:function>
</xpf:category>
</xpf:xpathFunctions>
39
Custom XPath functions - Feature HighlightsRules for writing Java code
39
– Only a subset of Java data types is supported (e.g. Strings,
primitives, dates, times, XMLObject and DOM Element, …)
– Only single-dimensional arrays of supported types are allowed
– Functions with side-effects should not be used (e.g. DB updates
or starting/committing TX), since the XQuery optimizer might re-
order or eliminate certain calls as it sees fit
– Functions with void return are not supported. Using Java callout
is more appropriate in these scenarios.
40
Custom XPath functions demo
http://blogs.oracle.com/imc/entry/calling_custom_java_code_from
41
OSB 11g new features –
Transactional Message Flows
42
Message Flow Transaction - Overview
42
Atomic Message Flow
• Simple as checking a box
• All transactional work in message flow committed or aborted
• E.g. Publish, Service Callouts (QOS EO), Reporting, Java Callout, Route
Two settings for Proxy
• Transaction Required ?
• Same Transaction For Response ?
Benefits
• Message flow can execute within TX regardless of the Inbound Protocol
Application
Client
Service
Clients
Oracle Service Bus Enterprise
Services
ServiceProxy BusinessHTTP/SOAP
JMS
FTP
HTTP
JMS
43
Message Flow Transaction – Feature Highlights
43
• Any proxy can use a transaction so that the transactional
work done by the proxy is atomic, i.e. all committed or all
aborted
Transactions are declarative, i.e. a setting on the proxy
service – there are no pipeline actions to start/commit TX
• Both the request actions and response actions of a
message flow (i.e. entire message flow) for a given proxy
can execute in the context of the same transaction
44
Message Flow Transaction – Feature HighlightsNew options in proxy service configuration
44
If checked, OSB will ensure there is a transaction context in message flow by starting a
transaction if necessary
45
Message Flow Transaction – Feature Highlights“Transaction Required” setting
45
• If “TX Required” is set, when OSB starts a transaction, any request path action
executes in the context of this transaction
• This TX will get propagated to response path only if inbound endpoint is
synchronous, e.g. HTTP, SB, JEJB
Inb
ou
nd
en
dp
oin
t
Ou
tbo
un
d
en
dp
oin
t
Message Flow
request path
actions
Message Flow
response path
actions
TX begin
TX commit
46
Message Flow Transaction – Feature Highlights
46
For a one-way or async endpoint (e.g. JMS, Email, File, FTP):
If “Same TX for response” is set, the entire message flow (request AND
response actions) execute in the context of the same transaction,
regardless of whether the inbound endpoint is synchronous,
asynchronous or one-way
Inb
ou
nd
en
dp
oin
t
Ou
tbo
un
d
en
dp
oin
t
Message Flow
request path
actions
Message Flow
response path
actions
TX begin
TX commit
47
Message Flow Transaction – Feature Highlights
47
• If the inbound transport already starts a TX (e.g. File, FTP,
Email, SFTP, JMS XA, WS, Tux, SB, JEJB, …) then:
– “TX Required” flag is a NO-OP
– “Same TX For Response” flag will
• be a NO-OP for synchronous transports (SB, Tux, JEJB)
because TX gets propagated to response path by default in
these cases
• cause the response path to use the same (inbound) TX for
async or one-way transports (File, FTP, Email,…)
48
Message Flow Transaction – Feature HighlightsError handling
48
– TX-related errors (begin/commit/etc.) cannot be handled by user-
configured error handlers
– When OSB starts TX, any unhandled exceptions in OSB will cause
TX to be aborted
– With “Same TX for response” set that is true whether the
exception occurs on request OR response path
– Reply With Failure will also cause TX to be aborted
– Reply With Success/Resume will NOT cause TX abort
49
Message flow transactions demo
http://blogs.oracle.com/imc/entry/how_to_control_the_transaction
50
OSB 11g new features –
Native java support
5151
Application
Client
Service
ClientsEnterprise
Services
EJBs
• Support for handling Java Objects in OSB
• UseCases
– Mediate EJB invocation to leverage the monitoring, alerting and reporting
capabilities of OSB
– Expose pipeline as a SLSB (Stateless Session Bean)
– Java Object or POJO (Plain Old Java Object) manipulation in the pipeline
using Java Callout action
Proxy
Native Java Support - OverviewInbound and Outbound
Web
Services
JMS
EJB
Oracle Service Bus
Java CalloutBusiness
Services
Proxy Services
HTTP
SOAP
EJB EJB
JMSJMS
52
Native Java Support – OverviewJEJB transport
52
• New native EJB (JEJB) Transport
– Both Inbound and Outbound
– Supports 2.1 and 3.0
– Native Java Objects can be passed along to JMS, Java Callout
– Full Transaction and Security semantics supported
• JEJB Transport vs existing EJB Transport
– JEJB Transport supports both Inbound and Outbound whereas
EJB Transport supports only Outbound.
– JEJB Transport doesn‟t convert Java Objects to XML
representation.
53
Native Java Support – OverviewJMS transport enhancements
53
• Enhanced existing JMS transport to support JMS Object
messages
– Allow picking up messages of type Object from a JMS topic or
queue
– Allow dropping messages of type Object off into a topic or
queue
54
Native Java Support – Feature HighlightsJava object in the pipeline
54
• OSB enhanced to support Java Objects
• In the Pipeline, Java Object is represented as <ctx:java-content ref=”key1”
xmlns:ctx="http://www.bea.com/wli/sb/context”/>
Application
Client
POJOs
Request
Pipeline
Request
Pipeline$body
<ctx:java-content ref=“key1”/>
Register to Object
Repository
Key1={obj}
Transport Layer
55
Native Java Support – Feature HighlightsMessage format
55
• Message Format in the Pipeline– The invocation point is the top element
– Each argument is listed as a sub-element
– Primitives and string arguments are inlined
– POJO parameters referred by java-content ref.<soap:Body>
<tes:some-method xmlns:tes=”default/someURI"
<arg0>99</arg0>
<arg1>true</arg1>
<arg2><con:java-content ref=”key1” xmlns:con="http://www.bea.com/wli/sb/context”/></arg2><arg3><someXML .../></arg3>
</tes:some-method>
</soap:Body>
– XmlObject arguments can be inlined or passed as ref.
• POJOs can only be modified in the pipeline through Java Callout
56
Native Java Support – Feature HighlightsJEJB Inbound
56
• Inbound EJB Transport exposes the Pipeline as a Stateless Session Bean
– Communication between the client and proxy service is an EJB invocation
– Client defines the SLSB interface exposed by the JEJB Proxy service
– EJB artifacts are generated on the fly at the time of proxy creation
• Transaction and security context is propagated from the client into the Bus
Stateless Session Bean
Request Pipeline
Method1(Pojo1,…)
Method2(Pojo2,…)
Response Pipeline
Clie
nt A
pplic
ation
Method1
Invocation Point = “Method1”
Args= {Pojo1, …}
Result
57
Native Java Support – Feature HighlightsJEJB Inbound
57
• The URI for the EJB Proxy Service is a part the global JNDI name for locating the EJB within the remote JNDI context
58
Native Java Support – Feature HighlightsJEJB Inbound
58
• User Configurations:
– Dispatch Policy
– EJB Spec Version
– Pass XMLBeans by value
– Transaction Attribute
– Client Jar
• Client Jar contains the remote/home or business interfaces to be exposed by the proxy service. User selects the EJB interface to be exposed by the JEJB Proxy service
59
Native Java Support – Feature HighlightsJEJB Outbound
59
• Outbound EJB Transport is targeted to invoking Stateless Session Beans from the Pipeline
• Transaction and security context is propagated from JEJB business Service to the external EJB
Oracle Service Bus
Request Pipeline
Response Pipeline
JE
JB
Busin
ess S
erv
ice Enterprise
Services
EJBResult
Invocation Point = “Method1”
Args= {Pojo1, …}
60
Native Java Support – Feature HighlightsJEJB Outbound
60
Business Service URI points to the JNDI Provider and JNDI name of the Remote EJB
61
Native Java Support – Feature HighlightsJEJB Outbound
61
User Configurations:
– Dispatch Policy
– EJB Spec Version
– Pass XMLBeans by value
– Security Information
– Client Jar
• Client Jar contains the remote/home or business interfaces to be accessed by the Business Service. User selects the EJB Interface to be accessed by the JEJB Business service
62
Native Java Support – Feature HighlightsJMS Transport
62
• JMS Services configured with Messaging type „Java‟ can
receive/send JMS Objects messages
• Java Object Support for both JMS inbound and outbound
JMS
Business
Oracle Service Bus
JM
S P
rox
y
JMS
Queue
JMS
Queue
$body
Object
Message
Object
MessageRequest
Pipeline
JM
S B
usin
ess
Se
rvic
e
Register the Object with Object Repository
Retrieve the Object from Object Repository<ctx:java-content ref=”jcid" />
63
Native Java Support – Feature HighlightsJMS Transport
63
• Service Type
– A new Messaging
Service sub-type
“Java” for
configuring Java
Object support in
JMS
64
Native Java Support – Feature HighlightsJMS Transport
64
• Pipeline Message Format
– Object in the pipeline is represented by the XML snippet
containing the reference of the stored object<soap:Body
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<ctx:java-content ref=”jcid”
xmlns:ctx="http://www.bea.com/wli/sb/context" />
</soap:Body>
65
JEJB transport demo http://blogs.oracle.com/imc/entry/how_to_mediate_ejb_invocation
66
Additional information & resources
67
Additional information & resources
• Oracle Service Bus documentation: http://www.oracle.com/technetwork/middleware/service-bus/documentation/index.html
• OTN “Learn More” page - books, tutorials, etc: http://www.oracle.com/technetwork/middleware/service-bus/learnmore/index.html
• OSB samples: https://www.samplecode.oracle.com/sf/go/page1498
• OSB Workshops provided by ISV Migration Center.
If you want to attend the workshop, please contact Ruxandra
Radulescu at [email protected]
68
Dmitry Nefedkin
ISV Migration Center FMW Technical Consultant
Visit our team blog: http://blogs.oracle.com/imc
Q&A
69
70