There are three places for creating a mediator in WSO2 ESB. They are:
- <ESB_HOME>\repository\components\mediators
- <ESB_HOME>\repository\components\dropins
- <ESB_HOME>\repository\components\lib
Mediators
directory
You can create a regular non-OSGI mediator JAR into this directory. The system will convert the mediator JAR into an OSGI JAR and deploy it into the server. This way is easy and simple to use. In this way user cannot specifically use the OSGI features for the mediator. For example, user cannot make certain packages private or import specific versions of packages. Also user can put mediators that are class mediator as well as mediators that have its own XML configuration.
Tip: The recommended way is to put the JAR into the extensions
directory.
Dropins
directory
User need to build an OSGI bundle of the mediator and put it into the dropins
directory. This requires a basic knowledge about the OSGI and maven bundle plug-in. So it can beĀ difficult for a programmer who does not aware of the OSGI technologies. Since user have created the OSGI bundle he can use the OSGI features as he wishes. When creating the OSGI bundle? a mediator with a XML configuration should be a fragment of the synapse-core. If it is a class mediator, it can be a normal bundle.
Lib
directory
User can only put class mediator JARs into this directory. A regular JAR can be put into this directory and it will be automatically converted to an OSGI bundle by the system.
Note: In all these cases you have to restart the server after putting the mediator.