0

是否可以通过streaminsight获得连续的输出流?我的问题是,当我使用跳跃/翻滚窗口对输入流进行查询时,当没有输入事件时,查询不会给我任何输出。这听起来很正常,但是在没有输入事件的情况下,是否有可能获得一个每 5 秒输出一次的窗口机制?

这是我的代码,也许在此之后问题变得清晰:

var inputStream = CepStream<ServiceBusMessage>.Create("Inputstream Portal Orders");

// Counts the number of messages in a window of 5 seconds
var countStream = from w in inputStream.TumblingWindow(outputConfig.windowSize)
                  select w.Count();

var queryTemplate = app.CreateQueryTemplate("Count Window Portal Orders", "des...", countStream);

var queryBinder = new QueryBinder(queryTemplate);
queryBinder.BindProducer<ServiceBusMessage>("Inputstream Portal Orders", inputAdapter, config, EventShape.Point);

// Just an simple outputadapter
queryBinder.AddConsumer<long>("output", outputAdapter, outputConfig, EventShape.Point, StreamEventOrder.ChainOrdered);

var query = app.CreateQuery("Counter portal orders", "des...", queryBinder);

query.Start();

我想要的输出让我们说这个输入:

example input
input time 1: x
input time 2: x
input time 6: x
input time 16: x

expecting output:
2 events in last 5 seconds
1 events in last 5 seconds
0 events in last 5 seconds
1 events in last 5 seconds

希望这种窗口机制在streaminsight中是可能的,我在谷歌上搜索了很多东西,阅读了开发人员指南,但注意到处理有争议的输出或类似的东西。希望可以有人帮帮我!

4

1 回答 1

0

There are no windowing mechanisms that have the behavior you are wanting.

How are you using the output? There might be another way to tackle the problem.

于 2013-04-02T13:21:48.930 回答