AMQP (RabbitMQ) vs Kafka for asynchronous communication

AMQP and RabbitMQ

Kafka

Push vs Pull Based Messaging

Queues vs Topics

Credit
Reference

Some other quick differences

So what are their use cases?

  • Legacy Systems: In case of RabbitMQ, there might be times when you need to support legacy systems that use legacy protocols like STOMP or MQTT. You could also use a JMS plugin to communicate with JMS applications.
  • Complex Routing: As seen above, it is very easy to route RabbitMQ messages based on routing keys. If there is a requirement for routing messages based on a few criteria, RabbitMQ’s direct and topic patterns can be used to achieve routing.
  • Long running processes: RabbitMQ can be preferred in cases where there might be long running tasks. This is because there isn’t usually a need for Kafka’s strengths of storing and processing event data or replaying data. A queue of processes that need to get done satisfy this use case.
  • Log Aggregation: Kafka abstracts away the details of files and gives a cleaner abstraction of log or event data as a stream of messages. This allows for lower-latency processing and easier support for multiple data sources and distributed data consumption.
  • Stream Processing: Many users of Kafka process data in processing pipelines consisting of multiple stages, where raw input data is consumed from Kafka topics and then aggregated, enriched, or otherwise transformed into new topics for further consumption or follow-up processing.
  • Event sourcing: Kafka can be used as an event source. Which means that any changes in an application can be stored as events for later processing. This can help retrieve certain information that might get lost or corrupted during application run times.
  • High Activity: Kafka can be preferred to be used for high volume data ingestions from IOT devices and other data points which are consistently producing a lot of events.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store