← Back to team overview

mosquitto-users team mailing list archive

Re: Build up a MQTT server with about 20, 000+ subscribers

 

Horace,
Here is my case why I want to store message to DB:

   - The number of subscribers is large
   - We will have a type of message which needs publish and make sure it
   can be delivered to all users.
   - A lot of subscribers will be disconnect for a few days.

We will use QoS > 1 and Clean Session = false to make sure subscribers can
get the messages when they reconnected.   I think the queue will be large
in this cases.  So that I want to save the queue message to DB for
persistent and we can check the db and find out how many messages are in
queue and check if the message delivered  to specify subscriber.


So I think your implement will not meet my purpose.


On Wed, Nov 14, 2012 at 1:08 AM, horace <contactyunkong@xxxxxxxxx> wrote:

> i just implemented a database storing on server side, here is how i did it:
>
> 1. setup a broker(server), let's call it S,
>
> 2. Then build a client (call it A) using any server side language you like
> (i used python, you can try with C or PHP), Roger's source code package has
> a complete Python client implementation you can subclass from. In this
> client A, you can subscribe all kinds of topics you want to record in a
> database (I assume you know how to do that).
>
> 3. In the on_message method of A,  you need to add a *republish* step
> after you strong the data in db. You may need to *modify the topic text*a bit to avoid circular bounce back . If you don't do that but republish
> the message with same topic, the client A will get it again and keep
> storing and republishing the message over and over again. (obviously i made
> this stupid mistake, hah)
>
> 3. Then from the local client B..., you can publish any topics to S, S
> will send it to A, A will store it in db and republish it (with modified
> topic), then B/C/D/E/F… will receive it if they subscribed the topic.
>
> note: S and A can be running on same server, they can also be separated,
> it's your decision. for dev environment, you can definitely put S, A and DB
> on one machine.
>
> I may open source my implementation of these simple structure when it gets
> robust enough.
>
> -horace
>
>
> On Nov 13, 2012, at 12:17 AM, Joe Zhu <zhuzhuojiang@xxxxxxxxx> wrote:
>
> Our project need to setup and Android push notification service. I noticed
> many of projects are using MQTT protocol and I found this mosquitto.
>
>    - Any people has this experience for this? Will it be a problem while
>    the subscribers grow up?
>    - What configuration do I need to handle for 20,000+ subscribers with
>    QoS >1?
>    - Any dashboard and UI for mosquitto to monitor?
>    - Is it possible to integrate DB/Memcache/Mongodb for message tracking?
>
> I'm not sure if it is a right place to ask this type of question in this
> mailing list,  if not, sorry about it.
>
> Thanks.
>
>
> --
> Joe Zhu
>
> --
> Mailing list: https://launchpad.net/~mosquitto-users
> Post to     : mosquitto-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mosquitto-users
> More help   : https://help.launchpad.net/ListHelp
>
>
>


-- 
Joe Zhu

References