Add Sensorevents to CEP Engine and get a list of all properties

66 Views Asked by At

I want to build a CEP-Engine which is dynamic so you can add different event streams. As soon as a new stream is added, Esper should be able to read all the properties of the stream and put it into a list, for example. (For example integer id, long temperature, date timestamp etc.) Is this possible in Esper?

Would be very grateful for any help

2

There are 2 best solutions below

2
On

In order to add a stream at runtime you can use create-schema.

create schema MyStream(id int, ...)

For a stream that accepts events that an application sends using EPEventServive#sendEvent you should add the bus and public annotation (or set the equivalent compiler flags).

@public @buseventtype create schema MyStream(id int, ...)

You can now use this stream.

select * from MyStream

You can attach a listener and have it do some logic. The Esper examples have a lot of detail. The create-schema is used in the "runtimeconfig" example.

0
On

Thank you for answering. I'm afraid I didn't make myself clear. I want to be able to add event streams where I don't know beforehand what kind of properties the events have. So I don't know before if there is an integer ID or if there is a date timestamp and which payload might be there. As soon as I add such an unknown event, Esper should examine the stream and return the contained properties of the stream to me.