C# client library for subscribing/publishing MQTT (Really Small Message Broker)

85,120

Solution 1

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.

Solution 2

If you are using C# for the client, you may want to check out the library M2Mqtt. You can read everything a very detailed blog post about the library here: http://www.hivemq.com/mqtt-client-library-encyclopedia-m2mqtt/

Solution 3

You can go with ActiveMQ or RabbitMQ C# clients ... they both support MQTT ..

Share:
85,120
Riddle
Author by

Riddle

Updated on July 18, 2020

Comments

  • Riddle
    Riddle almost 4 years

    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?

  • Riddle
    Riddle almost 13 years
    1).Thank you for explaining about the license as I always have some difficulties in understanding those documents. If I understand correctly, Mosquitto cannot be hosted on Windows without Cygwin, am I right? and if host it on (Fedora) will it be possible to connect it from C#? 2.) I saw the C# libraries that you have mentioned but some said it is not a full library although I didn't understand what does it mean.
  • ralight
    ralight almost 13 years
    Mosquitto has a cygwin and a native version. The native version lacks some of the features of the cygwin version - the most noticeable feature being persistence backup to disk. Regardless where it's hosted you'll be able to write the client in whatever language you want. As far as I know, the mqttdotnet library is complete.
  • Riddle
    Riddle almost 13 years
    I would like to clarify my understanding on mosquitto. In the "mosquitto-0.11.3-win32-bin" folder there are two brokers mosquitto and mosquitto-cygwin. 1).So will I get the persistant database support if i run the mosquitto-cygwin? 2).Is "mosquitto-cygwin" same as the "mosquitto" exe(in src folder) we get if we complie in the cygwin? 3).If 'Yes' for question 2, is it possible to compile it into 64 bit version and how can I do it?
  • ralight
    ralight almost 13 years
    Yes, you get persistence support in mosquitto-cygwin.exe but not mosquitto.exe. mosquitto-cygwin.exe is the code compiled with cygwin. You can compile as 64-bit under Visual Studio but not cygwin at the moment.
  • Riddle
    Riddle almost 13 years
    Thx for your quick reply. I will start the integration soon.
  • GorvGoyl
    GorvGoyl over 7 years
    will mosquito be able to handle millions of IOT devices?