WebSphere

Dynamic routing using a database

Choose which service is used at run time, using a database to lookup service endpoints.

About this task

If your goal is to have service requests routed to endpoints that are selected dynamically, you can achieve this by using a database combined with a Database Lookup mediation primitive. The run time supports dynamic endpoint selection, but you must set the Use dynamic endpoint property in your mediation module.
Figure 1. Actor (service requester) and system (ESB)
Service requests can be routed to different service endpoints depending upon the entries in your database.
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 or a suitable database. You should refer to product documentation for these instructions.
Procedure
  1. The database administrator creates and configures a database to hold your service endpoint information. Ensure that the database can be queried to return service endpoints.
  2. The integration developer creates and exports a mediation module by completing the following steps.
    1. Create and configure a mediation module containing a Database Lookup mediation primitive. Use WebSphere® Integration Developer to create a mediation module containing a Database Lookup mediation primitive that refers to your database. Click this link to go to the topic for WebSphere Integration Developer.
    2. Ensure that the service endpoint is found at run time. If you want to select a service endpoint using the Database Lookup mediation primitive alone, ensure that the Message element property is set to /headers/SMOHeader/Target/address because this is where the run time looks for the dynamic endpoint. Click this link to go to the topic for WebSphere Integration Developer.
    3. Ensure that the run time uses dynamic endpoint selection for your mediation module. From WebSphere Integration Developer set the Use dynamic endpoint property in the callout node. In order for the run time to implement dynamic routing on a request, you must set the Use dynamic endpoint property in the callout node.
    4. Optional: Ensure that you can control dynamic endpoint selection from the runtime administrative console. Promote the Use dynamic endpoint property. WebSphere Integration Developer lets you promote 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 administrative console. Click this link to go to the topic for WebSphere Integration Developer.
    5. Set a default endpoint. You can specify a default endpoint that the run time uses if it cannot find a dynamic endpoint. You specify a default endpoint by wiring the reference to an import that has the default service selected.
    6. Export the mediation module. From WebSphere Integration Developer export the mediation module as an EAR file. Click this link to go to the topic for WebSphere Integration Developer.
  3. The runtime administrator deploys and administers the mediation module by completing the following steps.
    1. Deploy the mediation module. Use the runtime administrative console to install the EAR file as a new application. If you have promoted the Use dynamic endpoint property, you can change its value during deployment. Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.
    2. Optional: Ensure that dynamic endpoint selection is enabled. If you have promoted the Use dynamic endpoint property, check that it is set using the administrative console. Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.
    3. Start the application associated with the mediation module Use the runtime administrative console to start the application associated with the SCA module Click this link to go to the topic for WebSphere ESB. Click this link to go to the topic for WebSphere ESB for z/OS. Click this link to go to the topic for WebSphere Process Server. Click this link to go to the topic for WebSphere Process Server for z/OS.

Results

When a service request invokes your mediation module, the service request will be routed to the endpoint that matches your specification.

Example

Figure 2. Dynamic Routing using the Database Lookup mediation primitive
Database Lookup mediation primitive obtaining service  endpoint from database

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 20 June 2010 00:38:49 BST (DRAFT)


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wbpm.scenarios.esb1.620.doc/tasks/twesb_usecasedynamicrouting2.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).
iDoc on