19 Getting Started With Oracle Mediator
19 Getting Started With Oracle Mediator
This chapter provides you an overview of Oracle Mediator (Mediator) and also describes how to
create an Oracle Mediator service component.
19.1 Introduction to Oracle Mediator
Oracle Mediator provides a lightweight framework to mediate between various components
within a composite application. Mediator converts data to facilitate communication between
different interfaces exposed by different components, which are wired together to build a SOA
composite application. For example, a Mediator can accept data contained in a text file from an
application or service, transform it to a format appropriate for updating a database that serves
as a customer repository, and then route and deliver the data to that database.
Oracle Mediator facilitates integration between events and services, where service invocations
and events can be mixed and matched. You can use a Mediator component to consume a
business event or to receive a service invocation. A Mediator component can evaluate routing
rules, perform transformations, validate, and either invoke another service or raise another
business event. You can use a Mediator component to handle returned responses, callbacks,
faults, and timeouts.
This section provides an overview of Oracle Mediator features:
Transformations
Validations
Java Callout
Event Handling
Dynamic Routing
Error Handling
Oracle Mediator provides support for setting rules based on message payload or
message headers. You can select elements or attributes from the message payload or
the message header and based on the values, you can specify an action. For example,
Mediator receives a file from an application or service containing data about new
customers. Based on the country mentioned in the customer's address, you can route
and deliver data to the database storing data for that particular country. Similarly, you
can route a message based on the message header.
For more information about access header-based routing, see Section 20.2.2.9, "Access
Headers for Filters and Assignments".
Transformations
Oracle Mediator supports data transformation from one XML schema to another. This
feature enables data interchange among applications using different schemas. For
example, you can transform a comma-delimited file to the database table structure.
For more information about transformations, see Section 20.2.2.7, "Creating
Transformations".
Validations
Oracle Mediator provides support for validating the incoming message payload by using
a Schematron or an XSD file. You can specify Schematron files for each inbound
message part and Oracle Mediator can execute Schematron file validations for those
parts.
For more information about validations, see Section 20.2.2.10, "Using Semantic
Validation" and http://www.schematron.com/.
Java Callout
Oracle Mediator provides support for Java callout. Java callouts enable the use of Java
code, together with regular expressions.
For more information about Java callout, see Section 20.2.2.11, "Support for Java
Callouts".
Event Handling
An event is message data sent because of an occurrence of an activity in a business
environment. Oracle Mediator provides support for subscribing to business events or
raising business events. You can subscribe to a business event that is raised when a
situation of interest occurs. For example, you can subscribe to an event that is raised
when a new customer is created and then use this event to start a business process
such as sending confirmation email. Similarly, you can raise business events when a
situation of interest occurs. For example, raise a customer created event after
completing the customer creation process.
For more information about event handling, see Chapter 36, "Using Business Events
and the Event Delivery Network".
Dynamic Routing
Dynamic Routing separates the control logic, which determines the path taken by the
process, from the execution of the process. You can create a dynamic routing rule from
the Mediator Editor.
For more information about dynamic routing, see Section 20.2.3, "Creating Dynamic
Routing Rules".
Error Handling
Oracle Mediator supports both fault policy-based and manual error handling. A fault
policy consists of conditions and actions. Conditions specify the action to be carried out
for a particular error condition.
For more information about error handling, see Chapter 22, "Using Mediator Error
Handling".
Mediator serves the purpose of a bus. It can be best utilized when used for routing. It can do
routing based on many parameters and the best part is, the routing rules can be modified at
runtime, thus giving the flexibility to choose the target at any point in time.
BPEL
1) Complex Logic
2) Good Support language in form of activities
3) Performance wise very slow
4) Support of Dehydration and Instance Monitoring
5) For Long Running process BPEL is the Right Solution
6) To implement the contolled Transactions
Integration of Rules Engine and Human Workflow
7) To implement the service virtualization BPEL is not the right approach
Mediator
1) Less Complex Logic
2) Less Support
3) Three times faster than BPEL
4) No support of de hydration
5) For Long Running process not a proper solution
old ESB OESB was the primary ESB prior to BEA aquisition.
After acquisition of BEA its role is to provide mediation services between SOA
Suite components
In 11g this will be known as the Mediator and acts as a component in an SCA
assembly
the preferred platform for service virtualization and interactions external to the
SOA Suite
Currently OSB is only available on WebLogic server but the intention is provide it
on other platforms as well in the future
Mediator
o
V alidate
E nrich
T ransform
R oute
O perate
Message Throttling
Service Pooling
Reliable Messaging