Apologies for the delay in producing the next in this series of posts outlining the new functionality coming up in WebSphere ESB 6.0.2. However, I’ve got a few cycles to spare so I’m going to try and get the rest of them done in short order.
One of the big questions we get on WebSphere ESB is how can you dynamically select the endpoint to invoke from within a mediation flow? In 601 you are limited to defining imports for all the endpoints you may wish to invoke and then using the Message Filter primitive to route to one of them. Whilst this works, it isn’t very dynamic. If you want to add an endpoint then you need to go back to tooling and then redeploy.
Re-tooling and deployment may be acceptable if the interface of an endpoint has changed as you may well need to update the contents of the flow accordingly (for example by changing a transformation) but is overkill in the simpler case whereby the interface remains the same but you just want to change the endpoint the message is sent to. Just such a scenario was the basis for a Developerworks article by Greg Flurry.
The dynamic endpoint selection capability in WebSphere ESB 6.0.2 will solve this issue by allowing you to augment the Service Message Object during mediation with information on the endpoint that you want to invoke. So the next question is then how do you determine the endpoint?
Well, you could use the existing Database Lookup primitive or a custom mediation, but more interestingly you can also use a new primitive available in 6.0.2, funnily enough titled Endpoint Lookup. The interesting thing about the Endpoint Lookup primitive is that it interfaces with the WebSphere Service Registry and Repository. As such, you can configure the primitive to look up endpoints based on port types, versions and even perform more complex queries based on the ontology you’ve defined within your registry. The registry may return zero, one or more results which you can then select from using a variety of methods, for instance a combination of Message Filter and Message Element Setter.
All this works for endpoints using the SCA native bindings or SOAP/HTTP and SOAP/JMS.