#esper

질문실시간 이벤트 처리 방법(Esper 사용법)

java 에서 실시간으로 데이터를 입력하는 내용을 만들기 위해 알아보았습니다만... 방법을 잘 몰라서 ; 질문을 드리고자 합니다.   1.실시간 이벤트를 사용 하는 방법은 spark streaming, Esper 이 있는 것으로 알고 있는데요. 이 이외에 다른 쉬운 방법이 있나요? 2.Esper 에서 실시간 이벤트 사용 방법을 모르겠습니다. 본 사이트 : http://www.espertech.com/  설명서 : http://www.espertech.com/esper/esper-documentation/  설명 사이트 http://www.notforme.kr/archives/579  http://javacan.tistory.com/entry/Esper-Beginner-1-Quick-Start  http://sungsoo.github.io/2014/01/02/overview-of-esper.html  gitHub 적용 사이트 https://github.com/not-for-me/EsperStudyProject  https://github.com/espertechinc/esper  EPL 실험 해볼 수 있는 사이트 http://esper-epl-tryout.appspot.com/epltryout/mainform.html  를 참조해서 만들어 보았습니다. public void EesperExample2(UserInfoDto udto) { Configuration config = new Configuration(); config.addEventType("SearchYoutubeVo", SearchYoutubeVo.class.getName()); EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(config);   String epl = "select * , count(*) from SearchYoutubeVo.win:time(5 minutes)"; List<SearchYoutubeVo> vo; EPStatement statement = epService.getEPAdministrator().createEPL(epl); ExampleListener example = new ExampleListener(); statement.addListener(example); int EventCreateNum = 5;   //for(int i = 0; i < EventCreateNum; i++ ){ try { vo = youtubeSearchService.searchYoutube(udto); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } //} }   public class ExampleListener implements UpdateListener { public void update(EventBean[] newEvents, EventBean[] oldEvents) { EventBean event = newEvents[0]; System.out.println("Avg Rating of NFM = " + event.get("viewCount") + " Total Count: " + event.get("videoId")); System.out.println(event.get("count(*)")); } } &#39;vo = youtubeSearchService.searchYoutube(udto);&#39; 는  youtube 키워드를 입력해서 이를 가지고오는 내용입니다. &#39;UserInfoDto udto&#39; 유저의 관련된 정보를 가지고 오는 것입니다. 그런데 제가 하고 싶은 것은 처음에  youtubeSearchService.searchYoutube(udto); 사용해서 데이터를 가조고온 후, 5분 간격으로 데이터를 가지고 오고 싶은 것인데.... 방법을 전혀 모르겠습니다.   그런데 ExampleListener  는 전혀 실행되지 않고 있습니다.
1.6K
1
1
0
쵸파
쵸파·2019-01-16
굿