Skip to content

Instantly share code, notes, and snippets.

Avatar

Amit Rathi amit1rrr

View GitHub Profile
@amit1rrr
amit1rrr / WordCountDemo.java
Created Feb 28, 2018
Word count demo of Apache Kafka.
View WordCountDemo.java
// Serializers/deserializers (serde) for String and Long types
final Serde<String> stringSerde = Serdes.String();
final Serde<Long> longSerde = Serdes.Long();
// Construct a `KStream` from the input topic "streams-plaintext-input", where message values
// represent lines of text (for the sake of this example, we ignore whatever may be stored
// in the message keys).
KStream<String, String> textLines = builder.stream("streams-plaintext-input",
Consumed.with(stringSerde, stringSerde);