This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Deploying the custom mediator

For the above example, after you create the mediator, place the JAR file in the <EI_HOME>\dropins directory. However, there are three places inside the WSO2 EI distribution for placing the JAR file of a customer mediator. They are:

  • <EI_HOME>\extensions
  • <EI_HOME>\dropins
  • <EI_HOME>\lib

The recommended way is to copy the JAR files into the extensions directory. If you deploy a mediator through a Carbon Application (CAR file), it can only be accessed from the Sequences and Proxy Services within the same CAR file. You need to restart the server after copying the JAR file of the custom mediator into any of these directories.

Extensions directory

If you created a regular non-OSGI mediator, build it and copy the JAR file into this directory. The system will convert the JAR file of the mediator into an OSGI-JAR and deploy it into the server. This way is easy and simple.

However, in this method, you cannot use any OSGI features within the mediator implementation. For example, you cannot make certain packages private or import specific versions of packages. Also, in this method, other than Class mediators, you can use a mediator, which has its own XML configuration.

Dropins directory

 If your custom mediator is a Class mediator, it would be a normal bundle. Instead, if it is a mediator with an XML configuration, then it should be a fragment of the Synapse core, and thereby, you need to create an OSGI bundle for that. This requires basic knowledge about OSGI and the Maven bundle plug-in. If you created your custom mediator as an OSGI bundle, you can place its JAR file in the dropins directory. 

The benefit of creating the custom mediator as an OSGI bundle is that you can use the OSGI features in its implementation as preferred.

Lib directory

You can only copy JAR files of custom mediators, which are created using Class mediators into this directory. If you copy a regular JAR file into this directory, the system automatically converts it to an OSGI bundle.