[英]How to custom event adaptor in wso2 cep 4.1.0
我為jarfile制作插件。 然后我復制到dropin文件夾中的jarfile。 (參考https://docs.wso2.com/display/CEP410/Building+Custom+Event+Receivers )
我執行wso2 cep。 命令是'./wso2server.sh -DosgiConsole'. and 'osgi > ss event-adaptor-name'
'./wso2server.sh -DosgiConsole'. and 'osgi > ss event-adaptor-name'
選中了ACITVE!
但WSO2管理網頁不存在。 我的事件的“輸入事件適配器類型”不存在。
我檢查'osgi > bundle event-adaptor-id'
結果是
沒有注冊服務。
如何在WSO2 CEP中注冊服務?
我使用eclipse,而不是使用maven。 我使用插件項目。
在WSO2 CEP 4.1.0文檔中將自定義事件接收器公開為OSGI服務部分提供了一個示例,說明如何將自定義適配器注冊為OSGI服務。
參考上面指出的同一文檔,以下是自定義適配器在OutputEventAdapterFactory
服務下注冊自身的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}
(請注意,為了清楚起見,我沒有在上面發布完整的輸出)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.