如何在运行时从 Esper 配置对象中获取 eventType
How to get the eventType from Esper configuration object at runtime
我是运行一个使用 Esper 作为我的核心 CEP 引擎的应用程序。
当我尝试获取我之前在 Esper 运行时注册的事件类型时,我得到一个 UnsupportedOperationException。
esperConfiguration.addEventType(streamName, fieldNames, fieldTypes);
--------
//several lines later
--------
String[] propertyNames = esperConfiguration.getEventType(streamName).getPropertyNames();
我得到以下异常:
java.lang.UnsupportedOperationException: Obtaining an event type by name is only available at runtime
at com.espertech.esper.client.Configuration.getEventType(Configuration.java:905)
我无法理解为什么我的 API 调用不是 "at runtime",即使我重用了用于初始化 Esper 引擎的同一个对象。
EventType 对象在已初始化的引擎上可用。例如:
esperConfiguration.addEventType(streamName, fieldNames, fieldTypes);
EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(esperConfiguration);
String[] propertyNames = epService.getEPAdministrator().getConfiguration().getEventType(streamName).getPropertyNames();
我是运行一个使用 Esper 作为我的核心 CEP 引擎的应用程序。 当我尝试获取我之前在 Esper 运行时注册的事件类型时,我得到一个 UnsupportedOperationException。
esperConfiguration.addEventType(streamName, fieldNames, fieldTypes);
--------
//several lines later
--------
String[] propertyNames = esperConfiguration.getEventType(streamName).getPropertyNames();
我得到以下异常:
java.lang.UnsupportedOperationException: Obtaining an event type by name is only available at runtime
at com.espertech.esper.client.Configuration.getEventType(Configuration.java:905)
我无法理解为什么我的 API 调用不是 "at runtime",即使我重用了用于初始化 Esper 引擎的同一个对象。
EventType 对象在已初始化的引擎上可用。例如:
esperConfiguration.addEventType(streamName, fieldNames, fieldTypes);
EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(esperConfiguration);
String[] propertyNames = epService.getEPAdministrator().getConfiguration().getEventType(streamName).getPropertyNames();