IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Enterprise Service Bus programming > Invocation of Services > Dynamic invocation > Dynamic endpoint selection

Endpoint Lookup mediation primitive

Use the Endpoint Lookup mediation primitive to dynamically route messages to appropriate service endpoints. The Endpoint Lookup searches for service information in a WSRR registry.

You can use the Endpoint Lookup mediation primitive to retrieve service endpoint information from a WSRR registry that can be local or remote. The service endpoint information can relate directly to web services, or to SCA module exports, or to manually defined MQ, JMS and HTTP services.

In order to use the Endpoint Lookup mediation primitive you need to add service endpoint information to your WSRR registry.

The Endpoint Lookup mediation primitive lets you retrieve service endpoint information that relates to the following:

When the Endpoint Lookup mediation primitive receives a message it sends a search query to the registry. The search query is constructed using the Endpoint Lookup properties that you specify and the query might return nothing, or it might return one or more service endpoints.

The Endpoint Lookup primitive will update the target structure in the SMO header with the first service endpoint. The Endpoint Lookup primitive will then update the alternative target list with the remaining service endpoints.


Example scenario

Figure 1. Endpoint Lookup within a mediation flow

The fictional company Personal Holidays is making an internal service available to external clients using a mediation flow. If the server that runs the internal service fails, one or more back up servers which are also hosting the internal service are called instead, as shown in Figure 1.

The scenario is implemented by registering the service endpoints of the main server and the back up servers in WSRR. Personal Holidays then use the Endpoint Lookup Primitive to retrieve all of the endpoints from WSRR. Figure 2 shows the Endpoint Lookup mediation primitive's properties.

Figure 2. Endpoint Lookup mediation primitive properties

Personal Holidays also set the Try alternate endpoints property on the Callout node to try the main server endpoint first. If that fails, the Callout node will retry the call using the service endpoint information for the back up servers. The Callout node properties are shown in Figure 3 .

Figure 3. Try alternate endpoint property of the Callout node

By storing the service endpoints in WSRR, Personal Holidays can update their back up services at any time, without needing to modify the mediation flow component.

Dynamic endpoint selection