Mqtt push message based on the (a) Selection of Technology

background

App soap project structure originally transmitted the data, because the data part is dynamic, so the need to regularly poll for new data. Due to the size of the updated data itself is not very large, consider using message push way to update the data.

Technology Selection

mq program can choose from a lot of selection criteria that can be used to move quickly end, cross-platform (App now have two versions of Android and IOS), it can be used in complex network environments. mqtt fully meet the above requirements, first of all mqtt was developed by IBM led the design goal is to help embedded devices fast and stable data transmission, the protocol itself is open source, built on tcp protocol. And a large number of open source server and client implementation, now mqtt belong to eclipse Foundation. In github page mqtt implementation of relevant connections, links:  https://github.com/mqtt/mqtt.github.io/wiki/software?id=software

Server selection

Server implementations to choose from: https://github.com/mqtt/mqtt.github.io/wiki/servers

Briefly about the advantages and disadvantages of various implementations of (only illustrates the tried and test the other's own):

1.WebsphereMQ

mqtt protocol itself is proposed by IBM, but for the average user WebsphereMQ body is too big, too difficult to get started

2.Mosquitto

Official Website: http://mosquitto.org/  protocol type supported MQTT v3.1 / v3.1.1. Mosquitto itself is open source under the BSD license, the official website you can download the source code to facilitate their custom, but Mosquitto implemented by c, more difficult to get started. In addition Mosquitto provides libmosquitto for clients to use.

3.Eclipse Paho

Official website: http://www.eclipse.org/paho/ , attributable to eclipse Foundation provides an open mosquitto implementation address: iot.eclipse.org, port 1883. Mainly provide a large number of client implementation library (this project Andoird client uses https://www.eclipse.org/paho/clients/android/ )

4.emqtt

Official website: http://emqtt.cn/ , Great God domestic development of the service side, very tough. Based on erlang development, open source under the MIT license itself, the project hosted https://github.com/emqtt/emqttd , protocol support to MQTT V3.1.1, supports HTTP Publish API and WebSocket access, support for cluster deployment, support for plug-ins style development. Interception of the performance test as follows:
Performance Testing

Performance Testing


erlang is still difficult for the average user to use, if there is no custom development needs, consider using. Other authors provide client libraries, including the IOS client with a swift build.

 

5.Yunba.io

Official website: http://yunba.io/ , Aurora push original commercial platform created CTO Zhang Hu, erlang development, support HTTP Publish API and WebSocket, use the next, the results were good, IOS sdk docking of very simple, in addition sdk provides various platforms, most are implemented based on the existing open-source library. Free users have a certain limit, if need commercial support is a good choice.

6.Mosca

Node.js server to achieve the development of the project is hosted on https://github.com/mcollina/mosca , supports WebSocket access, open source under the MIT license itself. Redis support data persistence and mongo, deployment support docker. Second development is very simple, a major factor in this is the last item selected. Attached technical articles for mosca description of a blog of http://blog.shiqichan.com/introducing-mqtt/ , I was more than a reference in the development process, to express my gratitude.

Written in the last

In fact, a very important technology selection principle is to choose their own programs and not the best solution. In the next article will introduce the use of Mosca those pits were encountered secondary development, so stay tuned!

 


Reprinted: http://targe.me/2016/01/02/mqtt-three/

Guess you like

Origin www.cnblogs.com/youyong/p/11388327.html