Messaging Protocols

Notes
March 25, 2018

Messaging Protocols are simply protocols defined to allow communication between different devices(can be anything, radio, TV, fridge, computer,etc).

IP is one such protocol, which defines rules for communication between devices(here computers) over the Internet. IP has 2 types: UDP(User Datagram Protocol) and TCP(Transmission Control Protocol).

  1. UDP is  faster, but less reliable. Since the communication is one-directional, no confirmation message is sent from receiving end.
  2. TCP is comparatively slower, but more reliable. Since the communication is bi-directional, confirmation message is sent to the sender, every time receiver receives the message.

TCP and UDP are the most basic and other protocols are built on top of it, example – MQTT(Message Queuing Telemetry Transport), AMQP( Advanced Message Queuing Protocol), STOMP(Streaming Text Oriented Messaging Protocol). Different protocols are used based on the requirement.

MQTT

MQTT can be used when information needs to be sent from devices to a server. MQTT can be useful in collecting data from multiple small devices into a single server for analysis. It is a machine-to-machine(M2M)/IoT connectivity protocol.

mqtt://Host:[Port]?transportOptions

AMQP

AMQP is open standard application(layer) protocol. It supports interoperability(the ability of computer systems or softwares to communicate and exchange information and make use of it) at the transport layer. It is efficient, reliable and secure. It helps in routing and queueing messages.

amqp://Host:[Port]?transportOptions

STOMP

STOMP is a simplified messaging protocol. It is a text based protocol. It is language agnostic, meaning to say that, with the help of this protocol, a message broker built in one language is capable of  receiving communication from a client application built in another language. It’s similar to HTTP and works over TCP with the help of commands such as – CONNECT, SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, COMMIT, ABORT, ACK, NACK, DISCONNECT

Message Broker – It is an intermediary program module, that is responsible for translating messages into format that is understandable by both the ends. It translates message from the formal messaging protocol used by sender into the formal messaging protocol used by the receiver.

References: [1] Messaging Protocols Explained