Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
428 views
in Technique[技术] by (71.8m points)

Is Kafka global store visible from multiple instances of app

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 ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...