Multi-Instance Kafka Streams Applications
The stream processing clients can be run on the same physical machine or separate nodes.
From the perspective of a Apache Kafka cluster the instances all together act as a consumer group (and, by the rules of consumer group, they share the partitions in such a way that no two instances access a partition).
If a topology uses local state stores, they are owned exclusively (and not shared) by the instances themselves that have an exclusive access to the stores (that hold state based on the records in the exclusive set of partitions assigned to them).
In such a stream processing group, every
KafkaStreams streams client can however expose a user-defined endpoint (as a pair of host and port using application.server configuration property) that allows for discovering the location of and connecting to the state stores and the partitions available on the instance.
The KafkaStreams instances become discoverable as a feature of KafkaStreams libraray not some external discovery framework.
That distributed yet interconnected Kafka Streams application allows for developing APIs and services that could use the state distributed across stream processing nodes (that span over multiple machines).