Kafka can not push notifications to consumers. Consumers have to keep polling/consuming messages in order to receive them. This is the only way messages stored in Kafka can flow to consumers. The Consumer Design section in the Apache Kafka documentation explains why "consumer pulling" was choosed over "broker pushing".
Kafka stands out for its ability to handle high throughput and provide scalability, fault tolerance, and message retention. These features make Kafka ideal for a notification system where reliability and real-time processing are crucial.
How to Produce a Message into a Kafka Topic using the CLI? Find your Kafka hostname and port e.g., localhost:9092. If Kafka v2. 5+, use the --bootstrap-server option. If older version of Kafka, use the --broker-list option. Provide the mandatory parameters: topic name. Use the kafka-console-producer.sh CLI as outlined below.
The notification email service consumes email requests from the Kafka notification topic and processes them to send them to a third-party service. Modules like PT, TL, PGR etc make use of this service to send messages through the Kafka Queue.
Type your message into the command-line interface where the producer is running. Press enter to send the message. Open a new command-line interface tab or window, and start the Kafka console consumer to receive the messages. Use the same connection details as the producer.
Complete the following steps to receive messages that are published on a Kafka topic: Create a message flow containing a KafkaConsumer node and an output node. Configure the KafkaConsumer node by setting the following properties: On the Basic tab, set the following properties:
The main way we scale data consumption from a Kafka topic is by adding more consumers to a consumer group. It is common for Kafka consumers to do high-latency operations such as write to a database or a time-consuming computation on the data.