Q) What is
Mediator?
The Mediator is in charge of interconnecting, within an SOA
composite application, components that expose different interfaces. In
addition, the Mediator can perform duties such as filtering and making routing
decisions.
The composite editor in JDeveloper gives you the flexibility
to define the interface now, to choose an existing interface, or to define the
interface later as you wire components to the Mediator.
Transforming data from one representation to another is, along with routing, one of the key functions of the Mediator.
Provides mediation capabilities such as routing, transformation, and validation capabilities.
The mediator component enables data routing between the service consumer and provide based on routing rules.
Route a data btn service provider and consumers within a composite applications.
It support both Synchronous and Asynchronous routing of data.
VETRO- Validate,Enrich,Transform,Route and Operate.
Provides services like
-> Sequential and parallel routing
-> Message re-sequencing
-> Data transformation
-> Payload validation
-> Event Handling
Q) What
Is The Role Of Oracle Mediator?
Oracle Mediator provides a lightweight framework to mediate between various components within a composite application.
Oracle Mediator
converts data to facilitate communication between different interfaces exposed
by different components that are wired to build a SOA composite application.
Q) What Is The Purpose Of Oracle Mediator?
"Route: Determines the service component (BPEL process, business rule, human task, and mediator)
to which to send the messages."
"Validate: Provides support for validating the incoming message payload by using a schematron or an
XSD file."
"Filter: If specified in the rules, applies a filter expression that specifies the contents (payload) of a
message be analyzed before any service is invoked."
"Transformation: If specified in the rules, transforms document data from one XML schema to another, thus enabling data interchange among applications using different schemas."
Q) Define a
mediator with respect to the implementation process of SOA
Routing
Transformation
Filter: to give condition
The mediator is responsible for interconnecting a variety of
composite applications.
It is also quite adept at exposing different interfaces with
the varied number of components.
Moreover, the mediator can also perform various kinds of
duties which comprise (include) of filtering so that the routing decisions can
be implemented.
On the other hand, it is also important to note that the
composite editor which is present in the JDeveloper would give you the
usability to illustrate the interface.
Moreover, with the help of the mediator, you can change data from one representation to the other. It is also one of the critical functionalities of the mediator.
- Define interface later
- Asynchrounous Interface
- Synchrounous Interface
- One-way interface
- Interface definition
from wsdl
- Subscribe to events
Mediator component
Define Interface
Later: This option enables you to create a Mediator first, and later define
the interface for the services, or subscribe to events.
Asynchronous
Interface: This option enables you to create a Mediator component for
asynchronous interaction.
Synchronous Interface:
This option enables you to create a Mediator component for synchronous
interaction.
One-Way Interface:
This option enables you to create a Mediator component for a one-way
interaction process. In this case, the client sends a message to the service,
and the service does not need to reply or even acknowledge the receipt of the
message.
Interface Definition
from WSDL: This option enables you to define services for the Mediator
component from a WSDL file. A WSDL file describes the interface of a Mediator
such as schemas and operations.
Subscribe to Events: This option enables you to subscribe to a business event that is raised when a situation of interest occurs.
Target service
Filter expression
Execution type
Schematron-based validation
Transformations
Reply,callback and fault handlers
Define one or more routing rules that can:
Filter data
Transform data
Validate data
Q) How many types of routing rules are there?
1. Dynamic routing rule
2. Static routing rule
Q) What is resequencing in Mediator?
The re-sequencing feature of the Oracle Mediator reorders
sets of messages that might arrive to the Oracle Mediator in the wrong
sequence. You can define re-sequencing for all operations in an Oracle Mediator
or for a specific operation.
A Resequencer is used to rearrange a stream of related but out-of-sequence messages back into order. It sequences the incoming messages that arrive in a random order and then send them to the target services in an orderly manner.
It will sequence the output file in a sequence independent of the input order.
For the resequencer to work we need to have 2 values in the source payload. The first one is a sequenceID, and the next one is a groupdID.
The sequenceID will be used as identifier for the message itself.
The groupID will be used to group the messages in which the resequencer will rearrange the messages based on the sequenceID.
Different groups will have seperate processing, so they won’t have any influence on each other.
The mediator supplies us 3 types of resequencers :
-> FIFO Resequencer
-> BestEffort Resequencer
Q) Echo pattern of the Mediator
An Echo is a simple “reply to the caller” pattern where the requester immediately gets back a response.
Act as a callable service without routing to any other service.
EX:
In this example which is an echo pattern, the request comes from the WebService, goes to the mediator, undergoes some transformation in the mediator, and finally is routed back to the WebService.
we need to create a routing rule in the mediator with an Echo Pattern.
Double click on the mediator component in the composite.xml which will open a .mplan file which is the heart of the mediator component where all the operations of the mediator
Click on the + icon of the Routing Rules –> Static Routing Rule –> Echo
Q) What Is Echo In Oracle Mediator?
The purpose of the echo option is to expose all the Oracle Mediator functionality as a callable service without having to route it to any other service.
For example, you can call an Oracle Mediator to perform a transformation, a validation, or an assignment, and then echo the Oracle Mediator back to your application without routing it anywhere else.
For synchronous operations with a conditional filter, the echo option does not return a response to the caller when the filter condition is set to false. Instead, it returns a null response.
The echo option is available for asynchronous operations only if the Oracle Mediator interface has a callback operation.
In this case, the echo is run on a separate thread.
You can also echo source messages back to the initial caller after any transformation, validations, assignments, or sequencing operations are performed.
An echo can only be specified if the Oracle Mediator component has a synchronous or asynchronous interface.
Whether the echo is synchronous or asynchronous depends on the WSDL file of the caller.
The echo option is only available for inbound service operations and is not available for event subscriptions.
Ex:
Note: But if you want to implement the re-sequencing of incoming message before calling to external system/process, which can’t be achieve with BPEL. In this case we only Mediator can solve the problem.
Use-case: In banking systems or customer care center, when ever a customer approaches the system, a token id or request id will be issued based on the category/type of issues. For e.g. banks will issue a token id based on saving account or current account or demat account issue etc. when it comes to processing of the request, banks will process the customers in a sequence order. So the customer is supposed to submit the token id issued to them. If any customer bypasses other customers, the system will process those request until their turn comes up.
Validations
Oracle mediator supports validation of incoming message payload for structure and semantics.
Use an xsd file for structural validation
Use an schematron file for semantic validation.
Transformation
-> Oracle mediator supports data transformation from one xml schema to another.
-> Transformations, defined in xsl files transforms document data from one xml file to another.
-> Xsl files can be visually designed by using the xslt mapper provided by oracle jdeveloper.
-> The xsl file deployed with the composite application so that the mediator engine can process the mapping rule in an xsl processor available in the oracle SOA suit run-time environment.
Q) Event Delivery Network(EDN)
- Enable SOA with Event-Driven Architecture(EDA)
- Supports publish/subscribe architecture pattern
No comments:
Post a Comment