I like to write a Custom Mediator for the WSO2 ESB. I found some Tutorials for this, but I don't get it working in the WSO2 ESB. I think I maybe have an error in the path I need for the Class Mediator, but let me explain everything:
For writing this Mediator I use the WSO2 developer Studio for Eclipse Juno.
There I created a new ESB Mediator Project called "b64writer" with this content:
package org.wso2.carbon;
import org.apache.synapse.MessageContext;
import org.apache.synapse.mediators.AbstractMediator;
public class B64Mediator extends AbstractMediator {
public boolean mediate(MessageContext context) {
// TODO Implement your mediation logic here
String inhalt = context.getEnvelope().toString();
trace.trace("Message: " + inhalt);
return true;
}
}
In the next step I created a new Carbon Application Project, with the Mediator selected on "Dependencies". The config for this is:
- Group ID: org.wso2.carbon.b64mediator
- Artifact ID: b64mediator
- Version: 1.0.0
I used the button on the right side to create an archive. This archive I copied to "C:\wso2esb\repository\carbonapps\0".
And now my question: How can I use this Mediator? It should work like this:
<class name="org.wso2.carbon.B64Mediator" />
But it isn't. WSO2 ESB can't find the class. Where's my mistake?