MQTT相关

*************************************
http://mqtt-client.fusesource.org/
*************************************
MQTT is a machine-to-machine (M2M)/"Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

mqtt-client provides an ASL 2.0 licensed API to MQTT. It takes care of automatically reconnecting to your MQTT server and restoring your client session if any network failures occur. Applications can use a blocking API style, a futures based API, or a callback/continuations passing API style.

MQTT是物联网之上的机对机连接协议。设计目的是作为极其轻量的pub/sub模式下的消息传输通道。
对于远端连接,仅需要很少的代码量并且对网络带宽的占用很少。
MQTT-client提供对MQTT的ASL2.0认证API,如果有任何的网络连接问题,MQTT-client会自动重连到MQTTserver并且恢复客户端会话。
有三种风格的API,可供外部调用程序使用:
1、堵塞API;
2、基于未来的API;
3、回调API;
****************************
>>>>
1.MQTT收发消息都是字节数组,即byte[]。
****************************
>>>>
The MQTT protocol includes the following benefits:
>> Extends connectivity beyond enterprise boundaries to smart devices.
>> Offers connectivity options optimized for sensors and remote devices.
>> Delivers relevant data to any intelligent, decision-making asset that can use it.
>> Enables massive scalability of deployment and management of solutions.

MQTT协议的优点:
>> 打破企业连接活动的边界,可扩展到便携(灵巧)设备;
>> 针对传感器和远端设备,提供可优化的连接配置;
>> 可以分发数据到任何智能、决策评估设备上;
>> 能够让开发和管理类解决方案具有很好的可扩展性;
*******************
>>>>
MQ中MQTT协议的特性和使用场景分析:
特性:
1、低带宽
2、不稳定网络
3、3种服务质量 ==>QoS.AT_LEAST_ONCE || QoS.AT_MOST_ONCE || QoS.EXACTLY_ONCE
4、多种终端接入
5、可配置带宽限制==>setMaxReadRate || setMaxWriteRate
6、安全支持==> SSL和TLS
7、采用pub/sub模式
8、M2M ==>适合物联网应用

9、客户端可自动重连
*******************
>>>>Main-Class and Class-Path
Manifest-Version: 1.0
Main-Class: com.rf.test.MQTTClientPublisherTest
Class-Path: lib/mqtt-client-1.6.jar lib/hawtdispatch-1.18.jar lib/hawtdispatch-transport-1.18.jar lib/hawtbuf-1.9.jar

***********************

猜你喜欢

转载自can-do.iteye.com/blog/2246902