簡體   English   中英

WSO2 CEP執行計划錯誤

[英]WSO2 CEP Execution Plan Error

我剛剛開始測試WSO2 CEP。 我正在使用3.1.0版。

我已經使用單個屬性事件和一個非常簡單的查詢完成了首次成功的測試。 但是,不,我試圖使測試更加實際,並為事件添加了更多屬性,並提供了更復雜的查詢。 執行計划XML文件副本在我的消息末尾。

我不明白為什么查詢中的“ insert into so”語句會產生錯誤消息,指出輸出流定義了兩次。 實際上,流已導出。

當我刪除“ insert into so”時,該計划已部署,但沒有任何事件發生……

對我未按預期做的事情有任何想法嗎?

謝謝你的幫助。

問候。

XML文件:

<?xml version="1.0" encoding="UTF-8"?>
<executionPlan name="Fifi_Test_Execution_Plan_1" statistics="enable"
  trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
  <description/>
  <siddhiConfiguration>
    <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
    <property name="siddhi.enable.distributed.processing">false</property>
  </siddhiConfiguration>
  <importedStreams>
    <stream as="si" name="Fifi_Test_Event_Stream_1" version="1.0.0"/>
  </importedStreams>
  <queryExpressions><![CDATA[

from si#window.timeBatch(10 sec)
select code, count(code) as number, sum(value) as total
group by code
insert into so;

]]></queryExpressions>
  <exportedStreams>
    <stream name="Fifi_Test_Event_Stream_2" valueOf="so" version="1.0.0"/>
  </exportedStreams>
</executionPlan>

錯誤消息:

Exception: Invalid query specified, Stream so is already defined as StreamDefinition{streamId='so', attributeList=[Attribute{name='code', type=STRING}, Attribute{name='number', type=LONG}, Attribute{name='total', type=INT}]}, hence cannot define StreamDefinition{streamId='so', attributeList=[Attribute{name='code', type=STRING}, Attribute{name='number', type=LONG}, Attribute{name='total', type=LONG}]}

發生上述問題的原因只是通過異常表示。 下面是導致此問題的更詳細原因。

我認為,最初您已經創建了一個執行計划,該計划將事件導出到流“ Fifi_Test_Event_Stream_2”。 此流包含以下屬性,

attributeList = [屬性{名稱='代碼',類型= STRING},屬性{名稱='數字',類型=長},屬性{名稱='總數',類型= INT}]

但是,現在您編寫了另一個查詢來計算總和,在將總和導出到相同的流“ Fifi_Test_Event_Stream_2”(流“ so”只是流“ Fifi_Test_Event_Stream_2”的別名)之后,您就計算了總和。

由於您正在計算總和,因此導出的流包含以下類型的屬性,

[屬性{名稱='代碼',類型= STRING},屬性{名稱='數字',類型=長},屬性{名稱='總數',類型=長}]

然后,您將無法將這些事件轉發到流“ Fifi_Test_Event_Stream_2”。

暫無
暫無

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

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