Skip to content

Instantly share code, notes, and snippets.

@andybryant
Created June 8, 2018 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andybryant/902750a2f3566cdae2edbac94f5076c0 to your computer and use it in GitHub Desktop.
Save andybryant/902750a2f3566cdae2edbac94f5076c0 to your computer and use it in GitHub Desktop.
StreamsBuilder builder = new StreamsBuilder();
builder
.stream("orders")
.flatMap(Ops::splitOrders)
.to("order-items");
Topology topology = builder.build();
Properties config = new Properties();
config.put(StreamsConfig.APPLICATION_ID_CONFIG, "mySampleApp");
config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "broker:9092");
config.put(StreamsConfig.NUM_STREAM_THREADS_CONFIG, 8);
KafkaStreams streams = new KafkaStreams(topology, config);
streams.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment