0

My question is - I have Kafka stream processing micro service which listens to multiple topics. Aggregates the state from multiple topics and stores in state store. We send that aggregated message ahead to down stream system. Down stream system will response back with other message on different Kafka topic. Need to create global state store which is visible for all my micro service instances. Is it possible to achieve same in karka using global store ? Can I get sample code example on how to create one ?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • https://kafka.apache.org/documentation/streams/developer-guide/interactive-queries.html#querying-remote-state-stores-for-the-entire-app – OneCricketeer Jan 08 '21 at 17:24
  • I am asking about streambuilder.addGlobalStore(). If we add global store using this option then is that store visible accross multiple instances of given app? – Pradip Batule Jan 10 '21 at 07:19

1 Answers1

0

Quoted from documentation

The state that is locally available on any given instance is only a subset of the application’s entire state. Querying the local stores on an instance will only return data locally available on that particular instance.

An in this instance, to query across instances, you must expose the application.server, as discussed in the link in the comments. Also relevant: Is Kafka Stream StateStore global over all instances or just local?

However, GlobalKTable has a full copy of all data on each instance

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245