Roughly Following: https://docs.confluent.io/current/streams/developer-guide/interactive-queries.html#streams-developer-guide-interactive-queries-discovery
You can use this in combination with kafka-key-value-producer to locally test some availability & scalability scenarios. Keys 'a' through 'j' are printed when you query the state store. Spin up more than 1 instance, send it some data, and see where the keys go. Your input topic ('input-topic') must have > 1 partition. Once you sent some data, kill one or the other instance and see what happens. It's a valuable exercise to understand how kafka streams stores data with partitioning.
see bin/create-topics.sh # default num topics is 2, can specify differently
kafka-console-producer.sh --broker-list localhost:9092 --topic input-topic
kafka-console-consumer.sh --bootstrap-server localhost:9092
--topic output-topic
--from-beginning
--formatter kafka.tools.DefaultMessageFormatter
--property print.key=true
--property print.value=true
--property key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
--property value.deserializer=org.apache.kafka.common.serialization.LongDeserializer
kafka-console-consumer.sh --bootstrap-server localhost:9092
--topic output-topic
--from-beginning
--formatter kafka.tools.DefaultMessageFormatter
--property print.key=true
--property print.value=true
--property key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
--property value.deserializer=org.apache.kafka.common.serialization.StringDeserializer
sbt assembly