I understand that queries can be added/modified dynamically using JMX API, without bringing the CEP application down. But because a channel (relation or stream) has only a 1:1 mapping with a event type, any new query addition needs creation of a new channel and event-type. How can this be done dynamically - basically, dynamic creation of a EPM component.
No. You can't dynamically create new channels in the EPN, but you can dynamically assign the value of the "selector" of an existing channel via JMX. By doing this, you can control where the output of any new queries that you create will go (i.e. which existing channel).
To pre-create a channel, shouldn't we know what kind of events the channel will contain? One does not know the event-type of the query output beforehand and it may not map into existing event-types. Because of 1:1 mapping between channel and event, we cannot create any anticipatory channels before hand.
Please confirm as this is a crucial requirement for us.
Thanks for the reply. Even if we can dynamically spin off a new channel in a new application, your explanation is assuming that the event-type is still known beforehand. What if my dynamic query does NOT output HelloWorldEvent but outputs data that is not known before hand? We need to think in terms of some generic data - something like a map of name, value pairs. How does CEP handle this use case? From the information I collected so far, it sounds like this is not supported.
I guess we need channels that can support a concept of a generic event type.
It does not need to be for every query, but only for those queries that output a different structure, which in all likelihood, would also mean you need a different Java class handling the event downstream anyway.
But, perhaps if it is the case that you have a generic Java sink, then the option to go for is indeed that of the EventBuilder route (i.e. generic event-type).
Can you please show me an example how you visualize configuring a generic event-type (using EventBuilder) to a new channel in the new application (for a new query with a new output)? The event builder API will basically return an event of type Object. (createEvent() in com.bea.wlevs.ede.api.EventBuilder )