Sunday, October 12, 2014

Oracle OSB 12c: Pipeline templates in Oracle Service Bus 12c

One of the best thing for any developer is to write a code which can be used as many times in an enterprise application. Pipeline templates is one of such capability in Oracle Service Bus in which developer create a prototype of a  pipeline called as pipeline template and include all the component which can be use across the enterprise services. One such example can be a Error handler.

Here in this post I will try to explain and give an idea of how one can use the pipeline templates in its Oracle Service Bus application. I am going to create template in which I will include these components:

  • Validation
  • Error Handler
  • Logging
  • Alerts
  • Reports
As you can see these are the common components which can be used across all the Services in OSB.
Let me start with the basic.


Pipeline component in OSB provides message processing capability i.e. defines logic for routing, validation, manipulation of messages (transformation) or error handling etc.
Primary elements for Pipeline are:
  • Start Node: It is a by default node define automatically when you connect to proxy service.
  • Pipeline Pair: node for request & response pair processing.
  • Branch Node: node to route the message based on condition either on type of operation or values.
  • Route Node: this node set the destination of message otherwise by default echo the request i.e. request is passed to the response.
  • Error Handler: handle errors either on stage or node.

Note: Minimum start node and route node required for pipeline.

Pipeline Template:

A template in pipeline is a prototype of message flow for proxy services. It defines the reusable activities that are common across the business process for example validations on business messages, error handling, transformation of request and response messages etc.

How to create pipeline templates in Jdeveloper

1.       Right click on the projectà NewàPipeline_Template
2.       Template wizard appears, Enter all the information.
3.       Click Next to select service type.
4.       Finish.
5.       Now in the pipeline template add the route node, error handler or any logic which is common across the service. (follow the example)

Note: you cannot create pipeline templates in OSB console.

Pipeline Template Example

Code Structure
  • Two projects i.e. SharedSB and ConsumeTemplate.
  • SharedSB is project in which we store all the common resources that can be used in all the service bus application and In ConsumeTemplate I will create a pipeline on the basis of pipeline template.

Create Pipeline Template (CommonComponent.ptx)
  1. Create pipeline template CommonComponent.ptx

  2. Drag and drop all the components that you think can be re-used in many services. In this case I am using Validity, Error handler, reports, logging, Alerts.
  3. After configuring all the activities, you can lock the activities so that the same configuration can be used in all the concrete pipeline i.e. in the pipeline where you are importing the pipleline template.

Creating concrete pipeline using template
  1. Create proxy service.
  2. Create pipleline using the template and use same signature as of your proxy service.
  3. After importing template, implement message flow logic if required.
  4. Save and deploy both the projects SharedSB and ConsumeTemplate on Oracle Service Bus server.
  5. Test your application.


No comments:

Post a Comment