Turn: The similarities and differences between AMQP and MQTT messaging in RABBITMQ implementations

Source: Internet
Author: User
Tags rabbitmq

Transferred from: http://www.cnblogs.com/lucifer1997/p/9438186.html

After AMQP and Mqtt (up to one time) are implemented, multiple queues are used to topic Exchange to listen to the same topic (topic) with the same switch, and find that the situation is different and feel a bit interesting, so it is recorded.

Use 2 Mqtt (A, B), 2 amqp (respectively, C, D) while listening for a topic,

Then send 4 messages to this topic as MQTT (1, 2, 3, 4, respectively),

Then send 4 messages in AMQP mode (5, 6, 7, 8, respectively),

The results are as follows:

A:1, 2, 3, 4, 5, 6, 7, 8;

B:1, 2, 3, 4, 5, 6, 7, 8;

C:1, 3, 5, 7;

D:2, 4, 6, 8.

Note that AMQP is roughly the same as MQTT when it is sent in encapsulation, and there are differences in reception.

AMQP receives messages in the form of polling, while Mqtt can receive them all.

As I continue to explore whether there is an interplay between the two, I find some interesting phenomena:

1. When AMQP and Mqtt are online at the same time, the two sides do not affect each other.

2. When only AMQP is online, a message is received, and an MQTT starts listening, and MQTT does not receive the message.

3. Receive a message when MQTT is online only, and then an AMQP starts listening, and AMQP can receive messages.

According to 2, 3 I launched: MQTT cannot read offline messages in the queue, the queue message is not deleted after reading online, and AMQP can read offline messages in the queue, and messages are deleted after the message is read.

Then, based on 1, I suspect that Mqtt reads the message before AMQP (not knowing right).

Turn: The similarities and differences between AMQP and MQTT messaging in RABBITMQ implementations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.