簡體   English   中英

從wso2 EI發布統計信息到wso2流處理器

[英]Publish statistic from wso2 EI to wso2 Stream Processor

我需要知道如何通過事件發布者從Enteprise Integrator向Stream Processor發布統計信息。

我在我的EI上實現了事件發布者

<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="MessageFlowStatisticsPublisher"
  statistics="enable" trace="enable" xmlns="http://wso2.org/carbon/eventpublisher">
  <from streamName="org.wso2.esb.analytics.stream.FlowEntry" version="1.0.0"/>
  <mapping customMapping="disable" type="wso2event"/>
  <to eventAdapterType="wso2event">
    <property name="username">admin</property>
    <property name="protocol">thrift</property>
    <property name="publishingMode">non-blocking</property>
    <property name="publishTimeout">0</property>
    <property name="receiverURL">tcp://xxx:7611</property>
    <property encrypted="true" name="password">xxx</property>
  </to>
</eventPublisher>

在流處理器上我有簡單的siddhi應用程序用於接收數據並將它們打印到日志中,如下所示

@App:name("FlowEntryApp")
@App:description("Plan of flow entry")

@source(type='wso2event', @map(type = 'wso2event'))
define stream FlowEntry(compressed bool, tenantId int, messageId string, flowData string);

@sink(type='log', prefix='My flowEntry:')
define stream TestOutputFlowEntry(messageId string, flowData string);

@info(name='FlowEntryOutput')
from FlowEntry
select messageId, flowData
group by messageId
insert into TestOutputFlowEntry;

我還為我的代理服務設置了發布statstics的所有配置,作為“enable statistic”和“enable trace”。 當我調用我的服務時,eventPublisher將wso2event發送到SP,這是正常的。 但在SP方面,SP處理錯誤“沒有StreamDedinition for streamId org.wso2.esb.analytics.stream.FlowEntry:1.0.0存在於緩存中”

我知道,問題出在siddhi應用程序中,我定義流“FlowEntry”而不是“org.wso2.esb.analytics.stream.FlowEntry”,但siddhi語言不支持像''這樣的字符。 在流名稱中。

所以我嘗試在EI站點上更改流名稱,僅將eventPublisher中的streamName更改為'FlowEntry',同時我在eventstream文件夾中的json文件中更改了streamName,但現在當我調用我的服務時,EI不會向SP發送任何事件。

有人知道如何將org.wso2.esb.analytics.stream.FlowEntry流發布到SP,然后由siddhi處理它嗎?

可以使用源注釋中的wso2.stream.id元素覆蓋流名稱。

@source(type='wso2event', wso2.stream.id='org.wso2.esb.analytics.stream.FlowEntry', @map(type = 'wso2event'))<br>
define stream FlowEntry(compressed bool, tenantId int, messageId string, flowData string);

通過使用上面的源定義,'FlowEntry'仍然可以在Siddhi App中使用,而在thrift服務器中,流id將被定義為'org.wso2.esb.analytics.stream.FlowEntry:1.0.0'。

最好的祝福。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM