X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fwordcount%2Fquery%2FQueryApplicationConfiguration.java;h=3f866f01090491547b22f7f6b0f229afc5928004;hb=861c055cbdc7fe36fb924c5b694537df8eb06423;hp=9f6769f3d00d63125b59a57e4036535f2af3ef65;hpb=6c5e42de43030ce2e5d63be537d8d5a371369a8b;p=demos%2Fkafka%2Fwordcount diff --git a/src/main/java/de/juplo/kafka/wordcount/query/QueryApplicationConfiguration.java b/src/main/java/de/juplo/kafka/wordcount/query/QueryApplicationConfiguration.java index 9f6769f..3f866f0 100644 --- a/src/main/java/de/juplo/kafka/wordcount/query/QueryApplicationConfiguration.java +++ b/src/main/java/de/juplo/kafka/wordcount/query/QueryApplicationConfiguration.java @@ -18,11 +18,9 @@ import java.net.Socket; public class QueryApplicationConfiguration { @Bean - public QueryStreamProcessor streamProcessor( + public HostInfo applicationServer( ServerProperties serverProperties, - QueryApplicationProperties applicationProperties, - ObjectMapper mapper, - ConfigurableApplicationContext context) throws IOException + QueryApplicationProperties applicationProperties) throws IOException { String host; if (serverProperties.getAddress() == null) @@ -39,9 +37,19 @@ public class QueryApplicationConfiguration Integer port = serverProperties.getPort() == null ? 8080 : serverProperties.getPort(); + return new HostInfo(host, port); + } + + @Bean + public QueryStreamProcessor streamProcessor( + QueryApplicationProperties applicationProperties, + HostInfo applicationServer, + ObjectMapper mapper, + ConfigurableApplicationContext context) + { return new QueryStreamProcessor( applicationProperties.getApplicationId(), - new HostInfo(host, port), + applicationServer, applicationProperties.getBootstrapServer(), applicationProperties.getUsersInputTopic(), applicationProperties.getRankingInputTopic(),