Using mediation policies you can dynamically
control service interactions, using contextual information. Learn
how modules, target services, and mediation policies interrelate.
Mediation policies
Using mediation policies
you can dynamically configure service interactions, by overriding
the values of module properties. The module properties that you can
override are defined in a mediation flow. You define the override
values in a mediation policy.
Mediation policies are stored
in WebSphere® Service Registry
and Repository (WSRR), but you can create them using the Mediation
Policy Administration widget.
Creating modules that can use mediation policies
You
use WebSphere Integration
Developer to create modules with a mediation flow. The mediation flow
must include a Policy Resolution mediation primitive, which can access
mediation policies in WSRR. You define whether the Policy Resolution
mediation primitive retrieves mediation policies associated with the
module, a target service, or both.
When you create the mediation
flow you must include other mediation primitives, whose properties
you want to override.
- Use WebSphere Integration
Developer to create a module containing a Policy Resolution mediation
primitive. The Policy Resolution primitive must be placed before any
primitives whose properties you want to modify.
- Configure the Policy Resolution primitive.
- Specify the WSRR definition to use, or take the default definition.
- Define whether to retrieve mediation policies associated with
the module, a target service, or both.
- Optional: If you want to use a gate condition, create
a Policy condition name that matches the gate
condition on the policy. Specify where the condition value is found
in the message, by providing an XPath expression. For example, you
could create a Policy condition name of Age and
an XPath expression of /body/priceChecker/request/Age.
When service requests are processed, the value of condition Age is
set from /body/priceChecker/request/Age.
- Optional: If you want to associate mediation policies
with a target service rather than a module, add an Endpoint Lookup
mediation primitive before the Policy Resolution mediation primitive.
- Add other mediation primitives.
- Promote any properties that you want to override dynamically.
Only promoted properties can be overridden by mediation policies.
Configuring WebSphere ESB or WebSphere Process Server
The
application server must contain your module and be aware of the correct
WSRR.
- Deploy your module to WebSphere ESB or WebSphere Process Server.
- Ensure that WebSphere ESB or WebSphere Process Server have a suitable
WSRR definition for your module.
Configuring WSRR
When the Policy Resolution
mediation primitive processes service requests, it queries WSRR. Therefore,
WSRR must contain the relevant information about your modules and
services.
- Load the EAR file, containing your SCA module, into WSRR.
- Optional: If necessary, load the WSDL for the target
services that you want to use.
Using the Mediation Policy Administration widget
You
can use the Mediation Policy Administration widget
to create mediation policies and associate them with either modules
or target services. In addition, the widget creates policy
attachments that associate mediation policies with modules or target
services. The mediation policies and policy attachments are created
in WSRR.
For every property that you want to override you add
an assertion. The widget refers to the properties that you want to
override as assertions. In WSRR, the property overrides are assertions
on the policy. If you want to create a conditional mediation policy,
add a gate condition. In WSRR, the gate conditions are user properties
on the policy attachment.
- When you create a policy attachment using the Mediation
Policy Administration widget, the widget creates a single
policy attachment and one mediation policy for each group that has
an assertion.
- When you delete a policy attachment using the Mediation
Policy Administration widget, the widget deletes the policy
attachment and any of the mediation policies it attached, unless the
policies are being used by a different attachment.
When you use the Mediation Policy Administration widget
to attach mediation policies to target services, you can attach the
policies at the following levels:
- Service
- Endpoint
- Operation