shlogg · Early preview
Fahim Hasnain Fahad @fahimhasna13

Kafka Producer-Consumer Microservices With NodeJS And KafkaJs

Apache Kafka used as Pub-Sub broker in NodeJS microservices for 1 million user messaging. Message Queue vs Pub-Sub explained with example implementation of Producer-Consumer system using Kafka.

Apache Kafka is a distributed event streaming platform which can be used as a Pub-Sub broker in NodeJS microservices. Recently, I worked in a project where publisher needed to send messages to 1 million users and give the response back. Here, a cool thing can be done by Message Queue and we can send 1 million messages in a queue and it will send the messages to the users one by one. But, a pub-sub can broadcast to all instances of a consumer which are subscribed to a certain topic.

  
  
  The Magic of Message Queues vs. Pub-Sub in Kafka

When faced with such a massive scale of messaging, two...