How to make fanout in Apache Kafka?

Viewed 4543

I need to send message for all consumers, but before detect who should get this message, how to do that using Kafka?

Should I use Kafks stream to filter data then send to consumers? As I know each consumers should be added to unique consumer group, but how to detect in real time, who must receive message ?

1 Answers

Kafka decouples consumer and producer and when you write into a topic, you don't know which consumers might read the data.

Thus, in Kafka you never "send a message to a consumer", you just write the message into a topic and that's it.

Consumers just read from topics.

Related