Many customers have already build services with the Oracle SOA Suite. A part of these services are implemented with Oracle Enterprise Service Bus (ESB). After the acquisition of BEA System, Oracle introduced the new product; the Oracle Service Bus (OSB).
This product is positioned as standalone Service Bus. The ESB will be integrated into the new Oracle 11g SOA stack, and renamed into mediator as a component of the Service Component Architecture (SCA).
Business requirements can result that instead of using the ESB the OSB is required. This could result that customers already have implemented ESB services and they need to migrate to the OSB.
This article describes the approach on migration from ESB to OSB.
Assumptions
Migrating to the Oracle Service Bus requires knowledge of various technologies.
- Oracle Enterprise Service Bus
- Oracle Service Bus
- Oracle WebLogic
- Web Service Definition Language (WSDL)
- XML Schema definitions (XSD)
- XML Style sheets (XSLT)
- XML Query (Xquery)
- XPath
There are no tools yet for automatic migration of ESB services to OSB. That is why document give you best practise on this.
Tools that are used for the migration are:
- Oracle JDeveloper
- Oracle Workshop (Eclipse development)
Oracle JDeveloper
Oracle JDeveloper is use to view the ESB services. It is used to determine the dependencies of the artefacts that it is using.
Oracle Workshop
Oracle Workshop is used to build and deploy the new OSB services.
Approach
While there is no automatic migration, we need to rebuild the services in OSB. The approach is as follows.
Reuse the artifacts from ESB as much as possible. This means in practices that we will reuse the WSDL definitions, schema definitions and style sheets.
Open in JDeveloper the ESB services and determine the artifacts it is using;
- WSDL files
- XSD schema's
- Used elements
- Used namespaces
- Stylsheets
- Filters
- Adapters
Based on these artefacts, the OSB services can be build.
Development environment
Depending on the complexity of the OESB services, a different sequence of steps should be followed. First of all a project structure should be in place. In this project structure various components will be stored.
Projects
The Workspace (OSB Project Structure) should contain one OSB Configuration Project, give this configuration a name "MyOSBConfig" and an OSB Project called "MyOSBMigration". The former contains the server definition for an OSB Server running on
Folder Structure
Create for every ESB service, an OSB service with the following directory structure.
| ESBName | <ESBName> | |||
| Input | ||||
| WSDL | <WSDLFile> | |||
| Schema | <SchemaFile> | |||
| Element | <elementused> | |||
| Adapter? | ||||
| DB | ||||
| DatasourceJNDI | <JNDIdatasource> | |||
| Query | <query> | |||
| JMS | ||||
| JMSConnectionfactory | <jmsconfactory> | |||
| Queue/Topic | <queue/topicname> | |||
| File | ||||
| Directory | <directory> | |||
| Filename | <filename> | |||
| Output#1 | ||||
| FilterUsed | <Y/N> | <XPATHfilter> | ||
| WSDL | <WSDLFile> | |||
| Schema | <SchemaFile> | |||
| Element | <elementused> | |||
| Adapter? | ||||
| WS | <endpoint> | (MarkifthisaBPELWS) | ||
| DB | ||||
| DatasourceJNDI | <JNDIdatasource> | |||
| Query | <query> | |||
| JMS | ||||
| JMSConnectionfactory | <jmsconfactory> | |||
| Queue/Topic | <queue/topicname> | |||
| File | ||||
| Directory | <directory> | |||
| Filename | <filename> | |||
| Output#2 | ||||
| <nextoutput> | ||||
| Folder | Description |
| BusinessService | All the business services are located here. |
| ProxyService | All the proxy services are located here. |
| Schema | Local schema's in the project are located here. |
| Transformation | Local transformation files (XSLT & XQuery). |
| Wsdl | The interface definitions. |
For each ESB project copy the used XSLT files into the transformation directory.
Naming Convention
A recommended approach for naming conventions of OSB resources is to add the
prefix `PS_' for Proxy Services, `BS_' for Business Services, `XQ_' for XQuery
transformations, and append a version indication `_v1r0'. Examples:
Project: CollectOrderInformation
Proxy service: PS_GetOrder_RS_v1r0
PS_GetOrderLines_RS_v1r0
Bus. Service: BS_GetOrder_v1r0
BS_GetOrderLines_v1r0
Proxy Endpoints:
The enpoints of the proxy services will be renamed to
Common Schemas
All schemas of the Common data Model are imported in the OSB project in folder Common/Schema/. All generated or imported WSDLs should preferably refer to these schemas, potentially importing service specific schemas in the "Schema" folder of the respective service.
Implementation
Based on the pervious table the OSB service can be build. Execute the following steps to perform this.
Create the business services Create the proxy service Implement the message flow
Create a new business service for each output definition. If an external web service is called, import or consume the WSDL definition of that web service. The same applies if this service is a BPEL process. In this case some additional changes should be made, this is described in the next paragraphs..
If you are calling a BPEL process, you could use the BPEL transport instead of normal http protocol. The BPEL protocol is more efficient implementation on calling BPEL from OSB.
When the business service is created, the WSDL and schemas are copied into a folder of your project. After creating the business service move the WSDL files to the WSDL directory and the schemas to the Schema directory or to the Common/Schema directory.
Note: With BEA ALSB 3.0, you should remove the partner link bindings, otherwise the WSDL is invalid. This is fixed in OSB 10gR3.
Create the proxy service
Create a new proxy service for each input definition. If the service is based on a interface definition from an external web service is called, import or consume the WSDL definition of that web services.
When the proxy service is created, the WSDL and schemas are copied into a folder of your project. After creating the proxy service move the WSDL files to the WSDL directory and the schemas to the Schema directory or the Common/Schema directory.
Implement the message flow
Implementing the flow is the most important step of the migration. Based on the various output from the ESB, you should route the message to the various business services.
The most simple one is just create a routing node to call the services.



Stylesheets
Note that there can be issues with style sheets. The style sheet is based on the JDeveloper diagrammer, it is using namespaces and namespace aliases based on the interface definition of the ESB. Execute the test action on the replace action of the Oracle Workshop (Eclipse).
It could be that the style sheet is using Oracle SOA specific extensions or custom functions, these are not available in OSB. If this is the case, you should change the style sheet or, which is easier, create a XQuery transformation.
Deployment and Test
Deploy and test the OSB service, you could use various test scenarios and tools to perform this.
Test style sheets and XQueries from Eclipse. Test business services from the OSB Console. Test proxy services from the OSB Console. Use tools such as SoapUI to perform end-to-end tests.
Adapters
Database Adapter
Note that the current version of OSB does not have a DB adapters as in the ESB.
Therefore you should create the DB adapter in BPEL as a simple wrapper for this
query. The BPEL process should use the same input and output schema's and namespaces as generated in the partner link of the DB adapter. The future version of OSB 10gR3 will have support of the DB adapter.
JMS Adapter
The OSB has full support of the using JMS messaging.
Import WSDL from BPEL
The ESB service has both the Proxy Service as the Business Service based on the same WSDL that is `consumed' from the BPEL process. The steps to create a similar service in OSB are:
Import the WSDL from the BPEL process URI (?WSDL) by consuming froma URI. All included schemas are imported as well and stored in the samefolder. Leave the WSDL itself in the `WSDL' folder. Drag and drop the service specific schema to the `Schema' folder thereby automatically changing the reference in the WSDL. Change the references from either the WSDL or the service specific schema to the CDM schemas by changing the "schemaLocation" property of the "import"tag. Remove the imported CDM schemas from the `wsdl' directory. Add a Business Service in the `BusinessService' directory based on the imported WSDL. Add a Proxy Service in the `ProxyService' directory based on that same WSDL. Add a `Routing Node' to the Proxy Service and route to the Business Service.
Imported WSDL from ESB
The ESB service has a Proxy Service based on a ESB "generated" WSDL and the Business Service based on the WSDL of a BPEL process. The steps to create a similar service in OSB are:
Import the OESB "generated" WSDL in the Workspace `wsdl' folder. Add a "service" and a "binding" to that WSDL, because the WSDL is not well-defined, refer to the PortType of the WSDL. Create a Proxy Service in the `ProxyService' directory based on that WSDL. Import the WSDL from the BPEL process as described for the previous service migration; don't forget to move the schemas. Add a Business Service in the `BusinessService' directory based on the imported WSDL. Add a `PipelinePair' to the Message Flow of the Proxy Service. In the request Pipeline, add a `stage' with a `replace' action, change the XPath to `.', enter variable `body', in the expression select the XSL file and add the rootelement of the body (request) to the `Binding' box, check `replace node contents'. Same for the response `Pipeline', but obviously for the response XSL and the response rootelement. Add a `Routing Node' to the Proxy Service and route to the Business Service.

10 comments:
Hi
Why should you migrate to OSB. The ESB will continu as mediator. There is no reason to migrate.
I know ESB is more a oracle domain bus and OSB is more a standalone enterprise Bus which can interface with the technology domain.
The jca adapter will come in Q1 so you can better wait for this than using BPEL ( extra processes and extra code to maintain and a performance decrease).
Can you explain you do routing rules of a ESB router and how you can do this in a proxy service.
thanks Edwin
Edwin,
The ESB will fade away as Mediator in SOA Release 11. In the next releases more functionality of the OSB will be integrated in to this release. The ESB / Mediator will be an activity such as 'Route' in the SCA architecture.
Some customers want to move from ESB to OSB, for any business reason they have.
Marc
Nice post Marc,
we might have a go at the automatic conversion tool from OESB to OSB.
Like to contribute?
Cheers!
Jøran Lager
I do not expects a tool from Oracle. IMHO it is to complex to create this. Technically it possible, it is XML, but the file strcuture is too complex.
Now, that's a challenge :-P
We have a great deal of Oracle ESB integrations done at a customer and the potential for a migration tool is huge - and that's only for that customer. Imagine the potential for reuse... I've allready made a Maven Plugin that creates DOT-language diagrams for the Oracle ESB integrations so the model part on the Oracle ESB side is not too hard. Then we're left with the OSB model to deal with. Hard to imagine that the project structure for OSB projects would be that complex... How about you sending me a pretty simple OSB project to look at? You will find my email address looking at Oracle directory.
Cheers!
Jøran Lager
One of the issues from ESB to OSB are the extended functions that Oracle has implemented in ESB/BPEL, that are not available in OSB. In this case for example the XSL transformations, related functions are avaialable, but hten only in XQuery.
IMHO It is hard to write a tool for it. Otherwise Oracle has done it already.
Maybe they are working on it, but those signal did not reach me.
Hi!
Thanks for the heads up regarding the XSLT Extention Functions.
I guess I have to look into which XSLT Processor OSB is using and check out if there are any possibilities to add some extention functions to OSB then...
Also, even though it will not be possible to create a migration tool that covers 100% of the ESB features, it will save us time anyway...
Think we need to ask PM what plans they have regarding migration.
Thanks for your time Marc!
(And I really like your blog :-)
Cheers!
Jøran Lager
Hi Marc, thanks a lot for this post, it's really a good piece of information. Currently trying to migrate from OESB to OSB because of business decisions! and have some problems with some services.
When i try to create the business services with the WSDL files, it asks me for the port, which is present in jdeveloper but it doesnt recognize it in workshop. My question is, should i create the binding and the port in workshop because the WSDL is not well built? Or is there any other possible solution from the jdeveloper?
My app was almost in production with the esb and now im trying to migrate everything to OSB to analyze how complex is the migration process,
thanks again and excellent post!
Cheers,
Tom
TOm, that is correct, you have to change the WSDL :-(. Workshop is more strict in the WSDL syntax.
thanks for the quick response Marc!
Post a Comment