Tagged:

What is MQTT?

MQTT stands for Message Queue Telemetry Transport. MQTT is a publish/subscribe messaging protocol invented by Dr Andy Stanford-Clark of IBM and Arlen Nipper of Arcom (now known as Eurotech), in 1999.

MQTT is an extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks.

What is messaging protocol?

In JMS, there are basically two type of messaging protocol

  1. Point-to-Point (PTP)
  2. Publish/Subscribe (pub/sub)

1) Point-to-Point (PTP) Messaging protocol

Point-to-Point messaging protocol use queue as messaging domain. In this protocol user can send and receive messages from the queue synchronously or asynchronously. Each message received on queue is delivered to the specific user once and only one.
So, this protocol is similar to if any one sends email to you then only you can able to receive the message.

MQTT in Java - 02

2) Publish/Subscribe Messaging protocol

Publish/Subscribe messaging protocol uses topic as messaging domain. Publish/subscribe messaging protocol is something like; you are registered for some email service to get emails when the topics are published. So, when any topic gets published on it, then the entire subscribers receive one copy of the message.

MQTT in Java - 02

MQTT supports only publish/subscribe type messaging protocol.

1. MQTT Publisher

To publish the message using the MQTT protocol you need to define the MQTT publisher, using that you can send message to the messages to the topic.

The code snippet in next page will help you to create your own receiver and publisher to work with different MQTT Broker provider like (Apache Active MQ, Mosquitto, etc.).

  • chadaram vamsi

    im beginner. i want to use mqtt. from where i have to start, i mean how configure mqtt etc please rply me

    • keyur kalariya

      Hi chadaram vamsi,

      For configure mqtt first you need to
      setup your message broker.

      They are many messaging broker
      available in market like

      -Apache ActiveMQ

      -MosquittoMQ

      -IBM WebSphere MQ etc.

      So, you can choose any one and
      configure it.

      After that you need to register your
      topic name to it, any message for this topic coming to the broker it
      pass it to the mqtt message receiver

      to Configure mqtt with activeMQ add

      In transportConnectors in activemq.xml
      from apache-activemq-5.8.0conf .

      Than you can send and receive message
      using mqtt by implementing MessagePub(topinName, message) and
      messageRec().

      • chadaram vamsi

        i have installed rabitmq. how to connect mqtt in tabitmq with jboss

        thanking you