简体   繁体   English

我应该在哪里将包含WSO2 ESB自定义消息处理器的jar文件放入WSO2 EI安装中?

[英]Where have I to put the jar file containing a WSO2 ESB custom message processor into my WSO2 EI installation?

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. 我在WSO2 EI还很陌生 ,我正在尝试开发必须在ESB流程中使用的自定义消息处理器

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 目前,我只淘汰了SamplingProcessor类,该类为: https : //github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/message/处理器/impl/sampler/SamplingProcessor.java

into a Maven project. 进入Maven项目。

I am trying with a minimalistic scenario where I only override the setParameters() method inserting a simple log, this is my code: 我正在尝试一个极简主义的方案,在该方案中,我只重写插入一个简单日志的setParameters()方法,这是我的代码:

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. 我使用Maven创建了包含thi类编译版本的jar文件。

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? 我的疑问是:将生成的SamplingProcessorHeaderRateLimitation-0.0.1-SNAPSHOT.jar文件放到WSO2 EI 6.0.0安装中的哪里?

You should put it in wso2ei-6.0.0\\lib. 您应该将其放在wso2ei-6.0.0 \\ lib中。 Then, you should be able to reference it in your XML as com.mycompany.toolkit.messageprocessor.SamplingProcessorHeaderRateLimitation. 然后,您应该能够在XML中以com.mycompany.toolkit.messageprocessor.SamplingProcessorHeaderRateLimitation引用它。

However, I believe you cannot make it an abstract class as doing so will prevent WSO2 from instantiating it. 但是,我相信您不能使其成为抽象类,因为这样做将阻止WSO2实例化它。 So you should remove the 'abstract' keyword from your class. 因此,您应该从班级中删除“抽象”关键字。

Place the JAR file in the lib directory of WSO2 EI. 将JAR文件放在WSO2 EI的lib目录中。

<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 请参阅以下链接https://docs.wso2.com/display/EI600/Uploading+Artifacts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM