Wednesday 7 January 2015

Introduction to MQTT and MessageSight


Message Queuing Telemetry Transport (MQTT) can be used to connect various types of smart devices and applications that are measuring,monitoring, and, in certain cases, controlling the world today.
IBM MessageSight MessageSight is an appliance-based messaging server that is designed
to handle large numbers of connected clients and devices and process high volumes of
messages with consistent latency.
MQTT features:
·         Publish/subscribe
·         Topics and subscriptions
·         Quality of service (QoS) levels-MQTT defines three quality of service (QoS) levels for message delivery, with each level
designating a higher level of effort by the server to ensure that the message gets delivered.
Higher QoS levels ensure more reliable message delivery but might consume more network
bandwidth or subject the message to delays due to issues, such as latency.
·         Retained messages-With MQTT, the server keeps the message even after sending it to all current subscribers. If a new subscription is submitted for the same topic, any retained messages are then sent to the new subscribing client.
Comparison of MQTT and HTTP
Although comparison is often made between MQTT and other common protocols, the most
useful comparison is with the hypertext transfer protocol (HTTP) for the following reasons:
·         HTTP is the most widely used and available protocol. Almost all computing devices with a
TCP/IP stack have it. In addition, because HTTP and MQTT are both based on TCP/IP,
developers need to choose between them.
·         The HTTP protocol uses a request-and-response model, which is currently the most
common message exchange protocol. MQTT uses a publish/subscribe model. Developers
need to understand the relative advantages of each type of model.
                                      
Quick comparison of MQTT and HTTP

Good explanation on MessageSight
These days, mobile apps tend to follow a common well-established pattern when it comes to communications with enterprise systems. They tend to use standard paradigms, often leveraging HTTP and existing web server infrastructures with Enterprise JavaBeans(EJBs), request response and so forth. These models have proven to work well and to be scalable for traditional applications.
But once one tries to add more dynamic content to the applications, it becomes more difficult to scale. What if I would like to display continuously changing information in real time within my application? For instance, a live feed of news, play-by-play updates from a football game, continuous pressure readings from valves in a factory, incident reports in a city, the ability to chat with other users of the application and so on. It suddenly becomes more difficult to receive the data in real time when using conventional means. On the client side, using techniques like long polling are bad for the battery life of the device. On the server side, supporting a large number of concurrent users requires considerable amounts of resources.
That is when a new paradigm is required. Ideally, we need a lightweight bidirectional means of communication, one that is event driven with a very simple semantic: connect, subscribe, publish, disconnect.
If you want to display real time updates in your application, it should be as simple as connecting to your server and subscribing to a set of topics you are interested in. When a new message arrives, a callback function should automatically be called and then used to display the new content in the app.
That’s where IBM MessageSight can help you.
IBM MessageSight is an appliance-based messaging server that makes it extremely easy to make existing applications much more dynamic, much more “real time.” It supports the lightweight MQTT protocol natively or over web sockets. Using native clients for iOS and Android, or using a cross platform JavaScript client, developers can quickly start adding exciting dynamic real-time content to their existing applications.
Designed to scale since inception, IBM MessageSight can handle a large amount of concurrently-connected devices, while at the same time ensuring that communications are secure.
So, rethink what you can do with your mobile applications. It is time to think of enriching your application with dynamic, real-time content and differentiate yourself from the competition.

REF: http://www.slideshare.net/JohnSamuel17/ibm-messagesight-for-mobile-and-the-internet-of-things-29075268 -Good Introduction about MQTT and Messagesight
Hi readers...
 I am doing some experiments with IBM MessageSight and Sensors...
I will be posting the configurations of it as and when I am getting good results and you can also enjoy experimenting them...
Lets have fun reading :)