WSO2 CEP结果集中有多行 [英] WSO2 CEP Multiple rows in resultset

查看:83
本文介绍了WSO2 CEP结果集中有多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道WSO2 CEP/Siddhi查询是否支持返回多行(如果可以)如何将这些行中的数据映射到输出XML?例如我的事件流中有一个字段statusCode,该字段可以具有要编写查询的A/B/CI值,该查询可以为我提供过去5分钟内按状态类型计数的当前值,例如A-10,B-5,C-2 ..查询我使用statusCode分组以获取状态计数

I wanted to know if the WSO2 CEP/Siddhi query supports returning multiple rows if yes how data from those rows can be mapped to the output XML ? e.g. my event stream has a field statusCode which can have values A/B/C I wanted to write a query which gives me the count by status type for past 5 mins e.g A-10,B-5,C-2.. in the current query i used group by statusCode to get the count of status

 MyQuery- ...insert into TestStream statusCode, count(statusCode) as count group by  statusCode

and my output XML is something like

<statusSmry>
  <status>{statusCode}</status>
  <count>{count}</status>
</statusSmry>

the output i receive is something like

   <statusSmry>
      <status>A</status>
       <count>10</status>
    </statusSmry>
   .....
    <statusSmry>
      <status>B</status>
      <count>5</status>
    </statusSmry>
    ....
    <statusSmry>
      <status>C</status>
      <count>2</status>
    </statusSmry>

是否可以在单个XML中获得查询结果?也就是说,在上述情况下,单个XML中的A,B,C都算在内?

Is it possible to get results of query in a single XML ? i.e. in above case counts for A,B,C in a single XML ?

谢谢 拉吉夫

推荐答案

您所要求的内容在锡迪语中是不可能的.

What you asked is not possible in Siddhi.

这是因为无论何时发生输入事件,总计数都会被更新,同时需要触发相应更新组的输出以通知订户.由于这是实时过程,因此Siddhi无法累积所有事件并将其作为一个事件/XML输出.如果无论如何要累积事件,那么将要累积多长时间(1秒或1天?),以及输出需要以哪种格式发送,因此目前是一个问题(WSO2 CEP 2.0.1 )不支持积累.

This is because whenever there is an input event the total count will be updated, at the same time an output for the corresponding updated group need to be triggered to notify the subscribers. Since this is a realtime process Siddhi cannot accumulate all the events and output as one event/XML. If in any case its going to accumulate the events then there will be a problem for how long it's going to accumulate for, 1sec or 1day?, and in what format the output need to be sent, therefore currently it's (WSO2 CEP 2.0.1) not supporting accumulation.

如果需要此功能,则必须将CEP的输出发送到ESB并运行某种聚合过程.

If you need this feature then you have to send the output of CEP to an ESB and run some kind of an aggregation process.

Suho

这篇关于WSO2 CEP结果集中有多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆