Reputation: 43057
I am pretty new in WSO2 EI and I am trying to develop a custom message processor that I have to use into the ESB flow.
At this time I have only exteded the SamplingProcessor class, this one: https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/message/processor/impl/sampler/SamplingProcessor.java
into a Maven project.
I am trying with a minimalistic scenario where I only override the setParameters() method inserting a simple log, this is my code:
package com.mycompany.toolkit.messageprocessor;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.synapse.message.processor.impl.ScheduledMessageProcessor;
import org.apache.synapse.message.processor.impl.sampler.SamplingProcessor;
public abstract class SamplingProcessorHeaderRateLimitation extends SamplingProcessor {
private static final Log logger = LogFactory.getLog(ScheduledMessageProcessor.class.getName());
@Override
public void setParameters(Map<String, Object> parameters) {
logger.info("setParameters() START");
// TODO Auto-generated method stub
super.setParameters(parameters);
logger.info("setParameters() END");
}
}
I create the jar file containing the compiled version of thi class using Maven.
My doubt is: where have I to put the generated SamplingProcessorHeaderRateLimitation-0.0.1-SNAPSHOT.jar file into my WSO2 EI 6.0.0 installation?
Upvotes: 0
Views: 947
Reputation: 2346
Place the JAR file in the lib
directory of WSO2 EI.
<EI_HOME>/lib
Another Option:
The artifacts can also be updoaded through the admin console. Refer the following link https://docs.wso2.com/display/EI600/Uploading+Artifacts
Upvotes: 1
Reputation: 413
You should put it in wso2ei-6.0.0\lib. Then, you should be able to reference it in your XML as com.mycompany.toolkit.messageprocessor.SamplingProcessorHeaderRateLimitation.
However, I believe you cannot make it an abstract class as doing so will prevent WSO2 from instantiating it. So you should remove the 'abstract' keyword from your class.
Upvotes: 1