Installation and Configuration: Both AMQP and MQTT are easy to install. An application can then send a message to the broker on a specific queue, where it is forwarded to another. AMQP can be more difficult to configure if you need to use more complex routing capabilities. Kafka is the most complicated to set up as multiple producers, consumers and connectors need to be installed and properly configured, which requires deeper knowledge.
Complex Routing: MQTT allows only routing with queue names (topics) in it and messages that have this queue’s topics are sent there. While Kafka does the same thing, it can partition each queue and consumers can handle them separately. AMQP, on the other hand, has a variety of routing possibilities. It can organize messages by topic names like the other two and it can also publish messages to all subscribers connected to it. For a more complex solution AMQP can separate messages by complex calculations on the headers (e.g. having conditions in the header that subscribers must meet). An extra functionality in AMQP is a default queue where messages that have no queue specified are sent automatically.
Scalability of infrastructure: While both MQTT and AMQP follow a single-broker paradigm containing and maintaining the queues, only AMQP can work in multi-node mode which allows it to scale better horizontally. For Kafka, most of the logic is in the consumers which allows it to scale better compared to the other two.
Message Order: Both MQTT and AMQP guarantee ordering in the queue to different extents, but they both struggle once the messages are read by the subscribers. Kafka, on the other hand, guarantees the message order, no matter the condition due to its logging-style of queuing.
Retention: Messages in MQTT are only delivered once, while in AMQP more conditions for the message can be added (multiple reads, acknowledgments, etc.). However, once the conditions are met, the messages are lost forever. Kafka doesn’t remove the messages from its queue but rather every consumer moves its offset to the message it wants to read, which allows messages to be retained indefinitely (limited only by hardware considerations).
Negligible Latency: Due to MQTT’s simple logic and the small size of messages, it has negligible added latency to that of the network transfer. For Kafka, to guarantee a strict ordering and to put the messages in the correct part of the queue, it requires more time to acknowledge the message. This causes the latency to increase. Depending on the AMQP’s setup and the complex routing configured, its latency can increase to almost double the latency of the other two. However, with a simple set-up, it can be as fast as Kafka
Bandwidth Usage: MQTT is dedicated to constrained environments which makes its usage of bandwidth extremely optimal. Kafka uses more bandwidth due to its message composition and timestamps being used. AMQP usage of bandwidth is the worst out of the three protocols as the messages’ headers can be extremely large doubling the size of data to be transferred.