fix word count to query across instances, including other file
@@ -23,6 +23,7 @@ import org.apache.kafka.streams.kstream.KGroupedStream;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KStreamBuilder;
import org.apache.kafka.streams.kstream.TimeWindows;
+import org.apache.kafka.streams.state.HostInfo;
import java.io.File;
import java.nio.file.Files;
@@ -137,6 +138,7 @@ import java.util.Properties;
public class WordCountInteractiveQueriesExample {
static final String TEXT_LINES_TOPIC = "TextLinesTopic";
+ static final String DEFAULT_HOST = "localhost";
public static void main(String[] args) throws Exception {
if (args.length == 0 || args.length > 2) {
@@ -192,8 +194,9 @@ public class WordCountInteractiveQueriesExample {
static WordCountInteractiveQueriesRestService startRestProxy(final KafkaStreams streams, final int port)
throws Exception {
+ final HostInfo hostInfo = new HostInfo(DEFAULT_HOST, port);
final WordCountInteractiveQueriesRestService
- wordCountInteractiveQueriesRestService = new WordCountInteractiveQueriesRestService(streams);
+ wordCountInteractiveQueriesRestService = new WordCountInteractiveQueriesRestService(streams, hostInfo);
wordCountInteractiveQueriesRestService.start(port);
return wordCountInteractiveQueriesRestService;
}
