This documentation is for WSO2 ESB version 4.5.1. View documentation for the latest release.

Places for Putting Custom Mediators

There are three places for putting a mediator in WSO2 ESB 2.1. They are:

  • <esb_carbon_home>\repository\components\mediators
  • <esb_carbon_home>\repository\components\dropins
  • <esb_carbon_home>\repository\components\lib

Mediators Directory

User can put 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 mediators 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.