mosca icon indicating copy to clipboard operation
mosca copied to clipboard

Support cluster

Open mcollina opened this issue 11 years ago • 9 comments

https://github.com/isaacs/cluster-master

mcollina avatar Mar 13 '13 12:03 mcollina

could you not just use PM2 instead https://github.com/Unitech/pm2. This has a built-in loadbalancer which uses the node-cluster module.

wallies avatar Dec 06 '13 15:12 wallies

This is not going to happen, as Mosca requires a database. If it's LevelDB is an embedded one, and it's impossible to use inside cluster. If it's a remote one, then you can just spawn a set of Moscas and connect them to a remote broker.

So, it's not needed.

mcollina avatar Feb 12 '14 14:02 mcollina

It seems it will be possible to use LevelDB across multiple clustered instances with https://github.com/substack/level-party/issues/1.

mcollina avatar Feb 23 '14 19:02 mcollina

You can launch multiple mosca instances using Redis or Mongo.

No plans at the moment, but if you want to contribute I'll help you.

mcollina avatar Mar 19 '14 07:03 mcollina

Thanks for your reply. I use mulitple mosca instances with MongoDB. It works. About cluster. I just think can we use redis or something to implement cluster just like socket.io.

fubuki avatar Mar 20 '14 14:03 fubuki

Is it possible to have plugin option in mosca ?

karthik2883 avatar Apr 24 '17 04:04 karthik2883

@karthik2883 what do you mean?

mcollina avatar May 01 '17 08:05 mcollina

I mean custom plugin option (callbacks) . Some Mqtt broker are giving custom plugin option (callbacks) which can be customize to fit the requirement Example

  1. Authenticate user with database,
  2. Add or subscribe to default topics
  3. Save all the publish message into the db ,
  4. Publish message internally to the relevant topics These are some feature can be handle via plugin.

karthik2883 avatar May 03 '17 06:05 karthik2883

you can embed Mosca and use its own API to do all the above things

mcollina avatar May 03 '17 07:05 mcollina