问题描述
概述
我发送消息来回一个客户端(Android手机)和服务器(Windows Server)之间。使用基于TCP持久连接,该协议将是最好的解决方案。我期待在性能,可扩展性,信息的尺寸和电池寿命。消息必须按顺序到达目的地,并且不能重复。
I am sending messages back and forth between a client (Android phone) and a Server (Windows Server). Using a persistent connection over TCP, which protocol would be the best solution. I am looking at performance, scalability, size of messages, and battery life. The messages must arrive at the destination in order and can not be duplicates.
MQTT
这似乎是一个更好的解决办法,但似乎有大的实施有很多用户的小例子。我不知道我是否可以将这种到Windows服务器,或者它必须是另一个正在运行的应用程序或服务器。最后似乎有缺乏一般在其上的信息。
This seems like the better solution, but there seems to be little examples of large implementation with lots of users. I am not sure if I can integrate this into the windows server, or if it would have to be another application or server running. Finally there seems to be a lack of information on it in general.
XMPP
这似乎有大量的实施,例子,甚至是一本书:)。然而,主要目的似乎是IM客户端,像谷歌的谈话。这会不会是最佳解决方案的服务器和客户端之间的消息传递。我知道目前XMPP主要用于在客户端服务器到客户端架构。
This seems to have lots of implementation, examples, and even a book : ). However the main purpose seems to be for instant messaging clients and things like Google talk. Will this be an optimal solution to messaging between server and client. I know currently XMPP is mostly used in client to server to client architectures.
请纠正我,如果我错了,感谢您的任何指导。
Please correct me if I am wrong and thanks in advance for any guidance.
推荐答案
这取决于你正在努力做什么,你正在运行的硬件。
It depends on what you are trying to do and what hardware you are running.
MQTT具有非常低的保持活动的通信。 XMPP是一种即时通讯协议,并且在处理所有的客户端之间presence消息的高得多的开销。
MQTT has very low keep-alive traffic. XMPP is a an IM protocol, and has a much, much higher overhead in handling presence messages between all the clients.
如果你有一个小的内存占用约束,则不必处理XML解析器可以使利用XMPP是不可能的。
If you have a small memory footprint constraint, then having to handle the XML parser may make the use of XMPP impossible.
请记住,MQTT代表的消息队列遥测传输,也就是说,它是一种传输协议,并没有定义消息格式在所有 - 你必须提供这一点; XMPP是一种即时通讯协议,仔细定义了所有的消息格式和要求所有消息为XML。
Keep in mind that MQTT stands for Message Queue Telemetry Transport, i.e., it is a transport protocol and does not define the message format at all - you will have to supply this; XMPP is an Instant Messaging protocol which carefully defines all the message formats and requires that all messages be in XML.
在除了这一切:MQTT是一个发布订阅协议,XMPP是可以扩展即时消息协议(使用XEP-0060),以支持发布订阅。您需要考虑这个当您设计您的系统。
In addition to all this: MQTT is a publish subscribe protocol, XMPP is an instant messaging protocol that can be extended (using XEP-0060) to support publish subscribe. You need to consider this when you architect your system.
我们发现MQTT是安静的成功者。你milage可能会有所不同。
We are finding MQTT to be the quiet achiever. Your milage might be different.
这一切都取决于...
It all depends ...
追查最近宣布LinkedIn,他们讨论他们使用MQTT在他们的移动应用程序。
Track down the recent announcement by LinkedIn where they discuss their use of MQTT in their mobile app.
干杯马克
(BTW安迪是微客中他提到我们,我们是在中心的教育创新与技术(经济转型国家),昆士兰大学,布里斯班,澳大利亚)
(BTW Andy was slightly off in his reference to us. We are at Centre for Educational Innovation & Technology (CEIT), The University of Queensland, Brisbane, Australia)
这篇关于MQTT与XMPP应该选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!