問題描述
我需要為 Android 實現(xiàn)推送通知,但將無法訪問 Internet,并且只能訪問 Intranet.所以我想我不能使用 C2DM 和第三方 API,比如 UrbanAirship.所以我正在考慮使用 MQTT RSMB(真正的小型消息代理)、C# .net 作為代理的發(fā)布者和 Android 的 wMqtt.jar 作為代理的訂閱者.
我已經(jīng)下載了 RSMB 并找到了以下 exe:-broker.exe-stdinpub.exe-stdoutsub.exe
我已成功從 Android 訂閱并使用帶有主題的 stdinpub.exe 發(fā)布消息.
我想從你們那里得到一些關(guān)于以下方面的建議:
1). RSMB 是免費的嗎?還有其他適合我的選擇嗎?
2).我將如何使用 C#(用于發(fā)布和訂閱)連接到 RSMB 代理.是否有任何用于 RSMB 的 C# 客戶端庫?
3).MQTT的性能和可靠性如何?我可能需要同時推送數(shù)百條消息.
4).如果沒有其他方法,那么我正在考慮在我的 C# 應(yīng)用程序中執(zhí)行 stdinpub.exe.(這可能聽起來很糟糕).
我發(fā)現(xiàn)網(wǎng)絡(luò)上關(guān)于 MQTT 的信息很少,我真的應(yīng)該這樣做還是有其他選擇?
好的,這里有一個細目:
1) 您需要閱讀下載 RSMB 時附帶的許可證文件.我的理解是您不能將 RSMB 用于商業(yè)目的,如果 IBM 將其作為商業(yè)產(chǎn)品發(fā)布,您必須停止使用它.
有一個名為 Mosquitto(我開發(fā)的)的開源 MQTT 代理可用.它提供完整的 MQTT 協(xié)議支持,可用于多種平臺.它還包括 C 語言的客戶端庫,帶有 C++ 和 Python 包裝器,以及示例發(fā)布和訂閱客戶端.您可以在 http://mosquitto.org/
獲得更多信息2) 有兩個 C# 庫可用,盡管我自己從未使用過它們.您可以在 http://mqtt.org/software>
3) 我讓 RSMB 和 Mosquitto 在一臺舊的 VIA C3 600MHz 機器上每秒處理 1500 條消息(每條 100 字節(jié)).在更現(xiàn)代的硬件上,我希望它們的性能明顯更好.
關(guān)于MQTT的信息,希望mosquitto網(wǎng)站上有合理的數(shù)量——見http://例如,mosquitto.org/man/mqtt-7.html 概述.您也可以在 http://webchat.freenode.net/ 的 Freenode 網(wǎng)絡(luò)上的 #mqtt irc 頻道上提問.還有一個位于 https://launchpad.net/~mqtt-users 的郵件列表,可能有用.
恐怕我無法真正評論您是否應(yīng)該使用 MQTT 或其他東西.
I need to implement the push notification for Android but there will not be internet access and only intranet access is available. So I think I cannot use C2DM and third party API like UrbanAirship. So I am thinking of using MQTT RSMB(Really Small Message Broker), C# .net as Publisher to the broker and wMqtt.jar for Android as subcriber to the broker.
I have downloaded the RSMB and found the followings exe: -broker.exe -stdinpub.exe -stdoutsub.exe
I have successfully subscribed from Android and published messages using stdinpub.exe with topic.
I would like to get some advice from you guys on the followings :
1).Is RSMB free? Is there any other alternatives that suit my case?
2).how will I be able to connect to the RSMB broker using C# (for publishing and subscribing). Are there any C# client library for RSMB?
3).How is the performance and reliability of the MQTT ? I might need to push a few hundreds of messages at the same time.
4).If there is no other ways then I am thinking of executing the stdinpub.exe inside my C# application.(It might sound bad).
I find that there is very little information about MQTT on the web and should I really go that way or are there any other alternatives?
Ok, here's a breakdown for you:
1) You need to read the license file that was included with RSMB when you downloaded it. My understanding is that you can't use RSMB for commercial purposes and if IBM release it as a commercial product you have to stop using it.
There is an open source MQTT broker available called Mosquitto (which I develop). It provides full MQTT protocol support and is available for a number of platforms. It also includes client libraries in C, with C++ and Python wrappers, as well as example publish and subscribe clients. You can get more information at http://mosquitto.org/
2) There are two C# libraries available, although I've never used either of them myself. You can find a link to them as well as a whole load of other MQTT related software at http://mqtt.org/software
3) I've had RSMB and Mosquitto handling 1500 messages (100 bytes each) per second on an old VIA C3 600MHz machine. On more modern hardware I'd expect them to perform significantly better.
With regards to information on MQTT, I hope that there is a reasonable amount on the mosquitto website - see http://mosquitto.org/man/mqtt-7.html for an overview for example. You can also come ask questions on the #mqtt irc channel on the Freenode network at http://webchat.freenode.net/ There is also a mailing list at https://launchpad.net/~mqtt-users which may be of use.
I'm afraid I can't really comment on whether you should be using MQTT or something else.
這篇關(guān)于用于訂閱/發(fā)布 MQTT (Really Small Message Broker) 的 C# 客戶端庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!