【问题标题】:How to custom event adaptor in wso2 cep 4.1.0如何在 wso2 cep 4.1.0 中自定义事件适配器
【发布时间】:2016-07-11 11:22:07
【问题描述】:

我制作了jarfile的插件。我复制到dropin文件夹中的jarfile。 (参考https://docs.wso2.com/display/CEP410/Building+Custom+Event+Receivers

我执行 wso2 cep。命令是'./wso2server.sh -DosgiConsole'. and 'osgi > ss event-adaptor-name'选中ACITVE!

但是 WSO2 管理网页不存在。我的事件的“输入事件适配器类型”不存在。

我查看'osgi > bundle event-adaptor-id' 结果是

没有注册的服务。

如何在 WSO2 CEP 中注册服务?

我使用 eclipse,而不是使用 maven。我用的是插件项目。

【问题讨论】:

    标签: wso2 osgi bundle wso2cep


    【解决方案1】:

    Exposing Custom Event Receiver as an OSGI Service WSO2 CEP 4.1.0 文档中的部分提供了一个示例,说明如何将自定义适配器注册为 OSGI 服务。

    参考上面提到的同一个文档,下面是自定义适配器在OutputEventAdapterFactory服务下注册自己的点。

    context.getBundleContext().registerService(OutputEventAdapterFactory.class.getName(),
                        emailEventAdaptorFactory, null);
    

    如果注册成功,你会看到类似“osgi > bundle event-adaptor-id”的结果:

    osgi> bundle org.wso2.carbon.event.output.adapter.email
    org.wso2.carbon.event.output.adapter.email_5.0.10 [215]
      Id=215, Status=ACTIVE      Data Root=/home/userx/wso2cep-4.1.0/repository/components/default/configuration/org.eclipse.osgi/bundles/215/data
      "Registered Services"
        {org.wso2.carbon.event.output.adapter.core.OutputEventAdapterFactory}={service.id=117}
    

    (请注意,为了清楚起见,我没有在上面发布完整的输出)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多