0

Is it possible to get a continuous output stream With streaminsight? My problem is that when I make a query on the inputstream with a hopping/tumbling window, the query doesnt give me any output when there are no input events. This sounds normal but is it possible to get a window mechanism that gives me output every 5 seconds also when there are no input events?

this is my code maybe the problem becomes clear after this:

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();

The output that I want for let say this input:

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

Hope this window mechanism is possible within streaminsight, I googled for a lot of things read the developers guide but noting that handles contentious output or something similar. Hope someone can help me!

Carlo
  • 3
  • 2

1 Answers1

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.

TXPower275
  • 511
  • 2
  • 9
  • I'm in the learning phase with streaminsight so my output is just for debugging in my console but in future, I will couple another system on it that needs the output for calculating a prediction about the current values. I was thinking writing the data in a csv file so the other system can read the last values out of that file. But when there are no event because of the window mechanisms the file is not upto date. The coupled system would by a data mining system like a Neural Network or a Support Vector Machine. – Carlo Apr 03 '13 at 07:46
  • I was thinking inserting dummy events so the window is counting all the time and filtering out those dummy events after that I had my count window. Thanks for your help – Carlo Apr 03 '13 at 07:47
  • Your events have start and end times which determine if an event is valid. It's pretty safe to say that if there is no valid event at the time you are looking at, the count is obviously zero for that time. – TXPower275 Apr 03 '13 at 13:27
  • If you are writing the output to a file, and you are expecting a new count value every 5 seconds, you can use your output adapter/sink to write in the missing zero values for you. – TXPower275 Apr 03 '13 at 13:28