JMS, AMQP, mqtt differences and linkages

Source: Internet
Author: User

Messaging as a basic communication mechanism has been successfully applied around the world. Messaging has always been the only common means of communication between people, machines and people, and machines and machines. There are two basic mechanisms for exchanging messages between two parties (or more).

    1. Synchronizing Message Delivery
    2. Asynchronous Message Delivery

Synchronous messaging is used in this case when the message sender wants to receive a response within a time range before the next task. Basically, he was in a "blocking" state until the response was received.

An asynchronous message means that the sender does not require immediate response and does not block the entire process. Responses are optional, and the sender always performs the remaining tasks.

The technology mentioned above, when the programs on both computers communicate with each other, the widespread use of asynchronous message delivery. With the rise of the microservices architecture, it is clear that we need to use an asynchronous messaging model to build services.

This has always been a fundamental problem in software engineering, and different people and organizations are proposing different approaches. I will introduce the three most successful asynchronous messaging technologies that are widely used in enterprise IT systems.

Java Messaging Services (Java Messaging Service (JMS))

JMS is one of the most successful asynchronous messaging technologies. As Java is used in many large enterprise applications, JMS becomes the first choice for enterprise systems. It defines the API for building a messaging system.

Image source: http://www.javatpoint.com/jms-tutorial

The following are the key features of JMS:

    • Standard messaging APIs for the Java platform
    • Interoperability in Java or JVM languages such as Scala, groovy
    • No need to worry about underlying protocols
    • There are queues and topics two message delivery models
    • Support Transactions
    • Ability to define message formats (message headers, attributes, and content)
Advanced Message Queuing Protocol (Queueing Protocol (AMQP))

JMS is great and people are happy to use it. Microsoft has developed NMS (. NET messaging service) to support their platforms and programming languages, and it works well. But the problem of interoperability was met. Two sets of programs that use two different programming languages communicate with each other through their asynchronous messaging mechanisms. At this point, you need to define a common standard for asynchronous messaging. There is no standard underlying protocol for either JMS or NMS. They can run on any underlying protocol, but the API is bound to the programming language. AMQP solves this problem by using a standard set of underlying protocols that incorporate many other features to support interoperability and enrich messaging requirements for modern applications.

Image source: Https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_MRG/2/html-single/Messaging_Programming_ Reference/index.html

The following are the main features of AMQP:

    • Platform-independent, bottom-level message delivery protocol
    • Consumer-driven Message delivery
    • Interoperability across languages and platforms
    • It's the underlying protocol.
    • There are 5 types of exchange Direct,fanout,topic,headers,system
    • Cache-Oriented
    • Enables high performance
    • Support for long-period message delivery
    • Supports classic Message Queuing, looping, storing and forwarding
    • Support Transactions (cross-Message Queuing)
    • Support for distributed transactions (Xa,x/open,ms DTC)
    • Securing security with SASL and TLS
    • Support for proxy security server
    • Metadata can control message flow
    • LVQ not supported
    • Client side and server peer
    • Can be extended
Message Queuing telemetry transmission (Message Queueing Telemetry Transport (MQTT))

Now we have the JMS for Java-based enterprise applications and AMQP for all other application requirements. Why do we need a third technology? It is designed specifically for small devices. Devices with low computational performance do not adapt to the complex operations on AMQP, and they require a simple and interoperable way to communicate. This is the basic requirement for MQTT, and today Mqtt is one of the main components of the Internet of Things (IoT) ecosystem.

Image source: Https://zoetrope.io/tech-blog/brief-practical-introduction-mqtt-protocol-and-its-application-iot

The following are the main features of MQTT:

    • Stream oriented, low memory consumption
    • Designed to send short messages between small, silent devices over low bandwidth
    • Long-period storage and forwarding is not supported
    • Fragment messages are not allowed (it is difficult to send long messages)
    • Support topic Publish-Subscribe
    • Transaction not supported (basic acknowledgement only)
    • The message is actually short-lived (short cycle)
    • Simple username and password, based on the security of not enough information entropy
    • Secure connection not supported
    • Message not Transparent
    • Topic is global (a global namespace)
    • Support for up-to-date queuing (last value queue (LVQ))
    • Asymmetric client and service side
    • Cannot be extended

---------------------This article from Dongfengkuayue csdn blog, full-text address please click: 51329110?utm_source=copy

JMS, AMQP, mqtt differences and linkages

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.