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

被刻印的时光 ゝ 提交于 2021-02-11 14:22:45

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/65076816/add-sensorevents-to-cep-engine-and-get-a-list-of-all-properties

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!