0
프로젝트에서 espertech CEP를 구현했지만 모든 것이 훌륭하게 작동했지만 모든 트리거 이벤트 목록을 보여 드리고 싶습니다. 에스 페텍이 이것을 허락합니까?espertech CEP에서 트리거 된 이벤트 목록을 얻는 방법
프로젝트에서 espertech CEP를 구현했지만 모든 것이 훌륭하게 작동했지만 모든 트리거 이벤트 목록을 보여 드리고 싶습니다. 에스 페텍이 이것을 허락합니까?espertech CEP에서 트리거 된 이벤트 목록을 얻는 방법
기본적으로 CEP는 내가 아는 한 아무 것도 제공하지 않습니다.
하지만 항상 HashMap<String, List<EventBean>>
을 사용하여 수행 할 수 있습니다.
HashMap<String, ArrayList<EventBean>> eventsNeeded = new HashMap<String, List<EventBean>>();
Configuration configuration = new Configuration();
configuration.addEventType("Event", IEvent.class);
EPServiceProvider engine = EPServiceProviderManager.getDefaultProvider(configuration);
EPRuntime runtime = engine.getEPRuntime();
EPAdministrator admin = engine.getEPAdministrator();
engine.initialize();
int limit = 30;
String query = "Select instanceId, qty from Event where netValue >" + limit;
eventsNeeded.put(query, new ArrayList<EventBean>());
admin.createEPL(query).addListener((eventBeans, eventBean1) -> {
for (EventBean eventBean : eventBeans) {
eventsNeeded.get(query).add(eventBean);
}
});
sendEvent(runtime, new Event("X", 10, 1, 100, "A"));
sendEvent(runtime, new Event("X", 20, -1, 100.0, "A"));
sendEvent(runtime, new Event("X", 15, 1, 100.0, "B"));
//You can use eventsNeeded here
유스 케이스와 지금까지이 EPL 문 무엇인가
빠른 예는 같은 것입니까? 내가 패턴, 집계 또는 무엇을 당신이 대답을 할 수 있는지에 따라 달라질 수 있기 때문에 나는 묻고있다. 또한 "트리거 된 이벤트"는 무엇입니까? 출력 이벤트 또는 이벤트가 들어오고 무엇인가를 트리거합니까? – goodie
UpdateListener를 사용하여 이벤트 쿼리 문에 정의한 데이터 스트림에 따라 액션을 트리거합니다. UpdateListner는 작동하지만 호출 될 때마다 목록을 원합니다. 예를 들어, 값이 1보다 크면 updatelistener가 트리거되고 이벤트 정보가 인쇄됩니다. 지금은 간단한 이벤트에 대해 이야기하고 있습니다. – user1281678
"청취 할 때마다 목록"은 청취자가 호출 될 때 어떤 종류의 로그를 의미합니다. 청취자가 기록 할 수있는 것처럼 보입니다. – goodie