WebSphere

Dynamic routing using registry lookup

Choose which service is used at run time, using WebSphere® Service Registry and Repository (WSRR) 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 WSRR registry combined with an Endpoint Lookup mediation primitive. The run time supports dynamic endpoint selection, but you must set the Use dynamic endpoint property in your mediation module.

If you decide to use service-version-aware routing, service requests are dynamically routed to a specific version of a module.

Figure 1. Actor (service requester) and system (ESB)
Service requests can be routed to different service endpoints depending the entries in your registry.
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 WSRR registry. You should refer to product documentation for these instructions.
Procedure
  1. Optional: If necessary, the WSRR administrator creates and configures a WSRR registry. Click this link to go to the topic for WebSphere Service Registry and Repository.
  2. The integration developer creates and exports a mediation module by completing the following steps.
    1. Create and configure a mediation module containing an Endpoint Lookup mediation primitive. Use WebSphere Integration Developer to create a mediation module containing an Endpoint Lookup mediation primitive that refers to your WSRR registry. Click this link to go to the topic for WebSphere Integration Developer.
    2. Define the endpoint selection policy that should be implemented. If you want to select a single service endpoint using the Endpoint Lookup mediation primitive, choose a Match Policy of Return first matching endpoint and set routing target. If you want to use service-version-aware routing, choose a Match Policy of Return endpoint matching latest compatible service version.Click this link to go to the topic for WebSphere Integration Developer.
    3. Optional: If you want to use service-version-aware routing, there are certain properties you must set on the Endpoint Lookup. Service-version-aware routing makes use of endpoint information that is in an SCA module (not in a WSDL document). Therefore, you must set the Version property to be the version of the SCA module. The asterisk (*) wildcard character is supported for the version number (for example, 1.1.*). You must also set the Module and Export properties. The module name must be the original name of the module, not the name that contains the version number or unique cell ID. Click this link to go to the topic for WebSphere Integration Developer.
    4. 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.
    5. 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 runtime administrative console. Click this link to go to the topic for WebSphere Integration Developer.
    6. Optional: 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 a reference to an import.
    7. Optional: Wire another mediation primitive to the Endpoint Lookup mediation primitive. If the Endpoint Lookup mediation primitive has a Match Policy of Return all matching endpoints, you must use another mediation primitive to select one particular endpoint. If the Endpoint Lookup mediation primitive has a Match Policy of Return all matching endpoints and set alternate routing targets, you do not need another mediation primitive to select a particular endpoint: by default the first match is used for the dynamic endpoint. Click this link to go to the topic for WebSphere Integration Developer.
    8. Export the mediation module. If the mediation module is not versioned, you can export it as an EAR file. Otherwise, export it for command-line deployment and use the serviceDeploy command-line utility to build a deployable EAR file. Click this link to go to the topic for WebSphere Integration Developer.
  3. The WSRR administrator loads the documents that contain the service endpoint information, into WSRR.
    1. Load the WSDL documents or SCA modules into WSRR. If an SCA module contains versioning information, WSRR can be queried to obtain service endpoints that relate to a version of the module.Click this link to go to the topic for WebSphere Service Registry and Repository.
  4. The administrator creates a WSRR definition, and deploys and administers the mediation module by completing the following steps.
    1. If necessary, create and configure a registry definition. Use the runtime administrative console to configure a WSRR definition. 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. 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.
    3. Optional: Ensure that dynamic endpoint selection is enabled. If you have promoted the Use dynamic endpoint property, check that it is set using the runtime 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.
    4. 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 Endpoint Lookup mediation primitive
Endpoint Lookup mediation primitive, with Match Policy of All, wired to XSLT mediation primitive

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_usecasedynamicrouting1.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).
iDoc on