Now we are ready to program with the Apache Kafka publisher-subscriber messaging system. First, a few terminologies:
In Kafka, there are three types of clusters:
- Single node - single broker
- Single node - multiple broker
- Multiple node - multiple broker
A Kafka cluster has five main actors:
- Broker: The server - a Kafka cluster has one or more physical servers where each one may have one or more server processes running.Each server process is called a broker. The topics live on the broker processes.
- Topic: The queue is a category or feed name in which messages are published by the message producers. Topics are partitioned, and each partition is represented by an ordered immutable messages sequence. The cluster has a partitioned log for each topic. Each message in the partition has a unique sequential ID called offset.
- Producer: These publish data to topics by choosing the appropriate partition in the topic. To achieve load balancing, the message allocation to the topic partition can be done...