Adding your own mediations to WebSphere ESB
November 15, 2006 2 Comments
WebSphere ESB comes complete with a set of mediation primitives from which you can build up your mediation logic. But what happens when the supplied mediation primitives do not allow you to build the mediation logic you require? Don’t despair, there are still a couple of options open to you.
Write your own custom mediation
Adding a custom mediation (one of the supplied primitives) is the simplest way to add your own custom mediation logic. This is effectively a place in the mediation flow that calls out to another SCA Component which you implement yourself to provide your own logic. There are 2 approaches for doing this:
– A top-down approach – the best choice if your mediation logic is very specific to this mediation flow and unlikely to be reusable. In this case, your custom mediation logic (which can be composed visually using the snippet editor or written in Java) is effectively encapsulated in the flow.
– A bottom-up approach – the best choice if your mediation logic is likely to be reused. In this case the custom mediation is effectively a call out to another service which provides the implementation of your mediation logic.
WebSphere ESB v6.0.2 simplifies both the top-down and bottom-up approach making it even easier to add your own mediation logic using a custom mediation. Nigel Daniels has written a good article on how to contribute custom mediations here.
Adding your own mediation primitive
If the mediation logic you want to add is something very generic that might be reused in a large number of situations, or you want to have a mediation primitive with a different terminal configuration, you should develop your own mediation primitive which can be added to the WebSphere Integration Developer mediation palette. This allows you to define your own icon, terminals and properties for your mediation primitive. This effectively involves developing an Eclipse plugin for inclusion in the WebSphere Integration Developer tooling and an implementation plugin for inclusion in the runtime. The instructions on how to do this can be found here. Future versions of the tooling we will aim to make this process simpler.
Using the techniques described above, pretty much any custom mediation logic can be added into the mediation flow.