Dushyant Gupta
Dushyant Gupta

Reputation: 515

Using same kafka topic for two different environment

Scenario: I have 2 microservices: MS1 and MS2. MS1 produces a message (say msg1) on Kafka-topic1 and MS2 consumes msg1 from the Kafka-topic1. MS1 and MS2 are deployed on the DEV environment and I bring up MS1 and MS2 on local as well.

Question: Using single Kafka-topic1, is there a way to ensure that:

msg1 produced by MS1 on the DEV environment is consumed by MS2 on the DEV environment?
AND
msg1 produced by MS1 on the local environment is consumed by MS2 on the local environment?

Upvotes: 0

Views: 1091

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191844

If you use different consumer groups for each environment, then those environments would read all messages independently, regardless of where the message was produced from.

If you want to fully isolate the producers, then you need a different topic

Upvotes: 1

Related Questions