Choose which service is used at run time, by filtering
a message.
About this task
If your goal is to have service requests routed to one
of a predefined set of endpoints, you can achieve this by filtering
your messages using the Message Filter mediation primitive.
Figure 1. Actor (service requester) and system (ESB)
To dynamically route services complete the following
steps.
Note: these steps provide an overview, they do not include
all instructions for creating a complete mediation module.
You should refer to the WebSphere® Integration Developer for
these instructions.
Procedure
The integration developer creates and exports a mediation module by
completing the following steps.
Create and configure a mediation module containing
a Message Filter mediation primitive. Use WebSphere Integration Developer to
create a mediation module.
Define the filtering that should be performed. Update
the Message Filter properties to define the filter patterns against
which input messages are tested. You can define a number of filter
patterns.
Define the endpoints that the filters should use. You can route messages that meet the same filter pattern to
different endpoints, or you can route messages that meet different
filter patterns to the same endpoint. You determine whether messages
can be sent to multiple endpoints or one endpoint, by setting the Distribution
mode property.
Optional: Ensure that you can adjust aspects
of your routing, from the administrative console. Promote
the properties that you want to control. WebSphere Integration Developer lets you promote mediation primitive properties
so they are visible from the runtime administrative console as module
properties. You give alias names to promoted properties; and it is
the alias names that are displayed on the runtime administrative console.
Export the mediation module. From WebSphere Integration Developer export
the mediation module as
an EAR file.
The runtime administrator deploys and administers the mediation module by
completing the following steps.
Deploy the mediation module. Use the runtime administrative console to install the EAR file
as a new application.
Optional: Check that your mediation module has
the correct properties. You can check and set the values
of promoted properties using the administrative console.
Start the application associated with the mediation module. Use the runtime administrative console to start the application
associated with the SCA module (mediation modules are
types of SCA modules).
Results
When a service request invokes your mediation module,
the service request will be routed based upon your filtering criteria.
Example
Figure 2. Dynamic Routing using the Message Filter mediation
primitive