diff --git a/src/main/java/com/epita/guereza/EventStoreApp.java b/src/main/java/com/epita/guereza/EventStoreApp.java index 7d49bd6..aef6a4c 100644 --- a/src/main/java/com/epita/guereza/EventStoreApp.java +++ b/src/main/java/com/epita/guereza/EventStoreApp.java @@ -34,29 +34,21 @@ private void extractThen(final EventBusClient.Message msg, final Consumer { - extractThen(msg, o -> { - Event ev = new Event<>("CRAWLER_REQUEST_URL", String.class, (String) o); - eventStore.dispatch(ev); - }); - }); - eventBus.subscribe("/request/indexer/url", msg -> { - extractThen(msg, o -> { - Event ev = new Event<>("INDEXER_REQUEST_URL", String.class, (String) o); - eventStore.dispatch(ev); - }); - }); - eventBus.subscribe("/store/crawler", msg -> { - extractThen(msg, o -> { - Event ev = new Event<>("ADD_URLS", String[].class, (String[]) o); - eventStore.dispatch(ev); - }); - }); - eventBus.subscribe("/store/indexer", msg -> { - extractThen(msg, o -> { - Event ev = new Event<>("ADD_DOCUMENT", Document.class, (Document) o); - eventStore.dispatch(ev); - }); - }); + eventBus.subscribe("/request/crawler/url", msg -> extractThen(msg, o -> { + Event ev = new Event<>("CRAWLER_REQUEST_URL", String.class, (String) o); + eventStore.dispatch(ev); + })); + eventBus.subscribe("/request/indexer/url", msg -> extractThen(msg, o -> { + Event ev = new Event<>("INDEXER_REQUEST_URL", String.class, (String) o); + eventStore.dispatch(ev); + })); + eventBus.subscribe("/store/crawler", msg -> extractThen(msg, o -> { + Event ev = new Event<>("ADD_URLS", String[].class, (String[]) o); + eventStore.dispatch(ev); + })); + eventBus.subscribe("/store/indexer", msg -> extractThen(msg, o -> { + Event ev = new Event<>("ADD_DOCUMENT", Document.class, (Document) o); + eventStore.dispatch(ev); + })); } }