Rendered at 17:05:54 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
monkeyking135 22 hours ago [-]
I’m confused why this post is on the front page of HN. This isn’t new and they haven’t done a new release or something. Mosquitto is good and used all over the place but not sure why this is being posted.
gregsadetsky 21 hours ago [-]
I'm the OP - I just stumbled upon this project because I setup a self hosted MQTT server to read/write to/from a small PDU. Mosquitto worked great for that!
I hadn't heard of it, and thought to share it here. I'm not sure why people are upvoting it - but it's not impossible that others are interested in this topic as well..! Cheers
tehlike 13 hours ago [-]
fairly popular with homeassistant crowd.
_def 22 hours ago [-]
Combining the old with the new. Agentic pubsub?
riedel 21 hours ago [-]
Maybe NanoMQ 0.25, Rabbitmq 4.4, EMQX 6.3 or VerneMQ 2.2 would have been a bit more newsworthy. Mosquito seems to the rather boring but but stable reference for MQTT for years now.
edukite 22 hours ago [-]
Exactly, I honestly checked link thinking there's v6 of mqtt protocol and I slept something and was confused. So I checked comments because maybe I'm to stupid but nope. There's literally nothing
Since we are into it, just sharing then: I had a lot of success with RabbitMQ + it's MQTT plugin. AFAIK, it actually has the MQTT plugin now baked in by default. Never had any issue at scale, plus you get AMQP in your stack, and you can actually use AMQP to consume the messages originally received over MQTT.
atmosx 19 hours ago [-]
Are you running a cluster? What clustering strategy guarantees and what’s your recovery story?
burcsahinoglu 20 hours ago [-]
I had a terrible time with a cluster of RabbitMQ servers, the cluster was partitioning often, impacting the application. It seemed like it was very sensitive to transient network problems.
At the end we moved from a cluster to a single instance running on a over provisioned machine, that worked pretty well.
jorl17 19 hours ago [-]
At a previous job (many years ago) we used to run RabbitMQ. I hadn't configured it originally, but I was certainly left with it in pieces when it entered split-brain mode in the face of some bizarre network failure.
So we had our application talking to two nodes of a cluster, both working normally without talking to each other (nevermind the fact that the connectivity between the machines was fine). Some workers picked up jobs, others didn't. IIRC the app read requests from a queue and wrote replies to another one, so we'd have half of the jobs being picked up, and then half of the replies not being picked up (ergo, 75% of the requests failed). It was bizarre and nothing seemed to indicate there were issues with RabbitMQ itself. I don't even remember how we figured it out at the time.
It's been nearly 10 years, I'm sure that it's better, that I was inexperienced, that the original setup wasn't great. But that left me so sore on it that I have actively avoid it ever since.
Bonus points for having dealt with this while Django Celery apparently had two independent configuration mechanisms, and both were being used in this app. Fun times.
ramchip 16 hours ago [-]
The distribution story is radically different on modern RabbitMQ, they have quorum queues based on the Raft protocol that are very solid. What you deal with is probably mirror queues, which did have ugly split brain failure modes. Those were removed about 4 years ago.
jorl17 5 hours ago [-]
Glad to know! Maybe one day I'll finally get around to trying it again.
maxpert 17 hours ago [-]
Shameless plug I've implemented https://github.com/maxpert/strangeq with AMQP and plan to integrate MQTT as supported protocol for StrangeQ. Right now I was focused on really optimizing the implementation itself (which I did), MQTT + replication/distribution is next on my list.
petre 8 hours ago [-]
The problem we had was provisioning user accounts and topic ACLs on the broker over a HTTP API from another application. We used EMQX 5.9 and the mnesia backend to accomplish this. Mosquitto has an auth bakend but can only do this over MQTT.
keithnz 20 hours ago [-]
I've used this for quite a while as a gateway for sparkplugB such that things like ignition can pull our telemetry data (we do agtech monitoring, smart meters, power, water, soil moisture, temp, etc etc)
eska 4 hours ago [-]
Curious, do you have any standards particular to agtech? In manufacturing I also just went with mqtt+sparkplug and buttblasted the entire competition struggling with opc-ua.
acidburnNSA 16 hours ago [-]
Funny I was just updating my mosquitto configs bridging between my various family sites and my little VPS. It's a great way to track what's online.
Kinrany 20 hours ago [-]
Is it yet becoming more common to have brokerless protocols like ZeroMQ and Zenoh that do not require having a broker that is deployed separately?
stevekemp 7 hours ago [-]
It depends on the use-case. I've spent the past few days setting up home automation with some cheap zigbee devices.
There are a bunch of options but the one I settled on is zigbee2mqtt, which requires a broker for message-exchange. Once it was setup it was pretty trivial to write simple clients to connect to the mosquitto instance and read/modify device state.
(e.g. I wanted something that would turn on my bedside light at 6am, and something else that would trigger some flashing lights when my laundry machine was finished and I did that via some external processes.)
InsidiousWombat 16 hours ago [-]
The broker is the point.
brokerless is nice niche for when you have pretty constrained use case but just not traversing network well (zmq requires multipath for any sensible patterns) already roots many use cases out, as is the authentication
Kinrany 6 hours ago [-]
Sure, you want a broker in most cases, but doesn't it seem wrong that the protocol has to know that? The broker shouldn't be much more than a combination of a router and a dumb pipe.
eska 4 hours ago [-]
Something else to look into is DDS for P2P with broadcasting in the local network.
coderenegade 16 hours ago [-]
Depends on the task. For one-to-one comms you could use zmq, but if you need one-to-many, mqtt is a lot better. Mqtt also scales nicely after the fact, as you can hook additional services in without disrupting what's already in place.
clbrmbr 19 hours ago [-]
a PITA to scale. or maybe i just don't know how to infra?
i picked mosquitto but had to ditch it for AWS IoT Core and have not looked back.
jon-wood 7 hours ago [-]
It depends what you mean by scaling. Mosquitto is impressively performant so you can go a long way just running a single instance on a server with a decent chunk of RAM and a reasonable CPU.
HA is a more difficult thing to solve, I believe Cedalo sell a version with HA support which may solve all this but the open source version doesn’t really have any good answers. The usual approach seems to be setting up topic replication between all your nodes and putting a load balancer in front.
Thankfully the system I’m responsible for can tolerate outages so we just work on the basis that we have regular snapshots and can stand up a new instance if the one handling traffic fails, with the fault tolerance sitting on the client side with messages being queued for transmission when the connection comes back.
gkhartman 18 hours ago [-]
These days I'd go with NATS if you need to scale, especially with on-prem servers.
oulipo 21 hours ago [-]
Now the default seems to be EMQX, there's also a possible project to include MQTT5 compatibility in NATS (but they push back because they are selling this in their Entreprise version), what stack do people use here for MQTT?
zimpenfish 8 hours ago [-]
For my Home Assistant broker, I use comqtt[0]. Previously used hmq[1] but ran into some weird problems that I couldn't debug.
I fixed all this + way more: Shameless promotion for my bridge
Nats MQTTv5 with support websockets and other improvements are near first alpha release
https://github.com/nberlee/mqtt-nats-broker
edukite 21 hours ago [-]
My company is using mosquito for multi source event stream. This is why I was so confused
fires10 20 hours ago [-]
We use HiveMQ and some mosquito. Rabbitmq did not have good qos2 support. I would like to see more options in this space. Mosquito did not have good cluster support from my perspective.
indianaman11097 11 hours ago [-]
[flagged]
xiaoliangliang 12 hours ago [-]
[flagged]
11 hours ago [-]
cyberax 19 hours ago [-]
It's written in C. At this point, this is an instant disqualification for a network service.
I will always choose Rust over C/C++ for new projects any day of the week but this is kind of a bad take.
k0morebi 19 hours ago [-]
Oh boy. You're going to hate to know what programming language is used for apache, nginx, postfix, postgres, MySQL/mariadb, redis, wireguard and the majority of network hardware.
cyberax 19 hours ago [-]
Absolutely. And I'm not using Apache, nginx, or postfix as a result. I'm also using userspace Wireguard, written in Rust.
For services that can't be avoided, I try to limit their exposure. I run Postgres with strictly controlled network access. Same for Redis.
cowlevel 15 hours ago [-]
Which kernel do you use?
yjftsjthsd-h 17 hours ago [-]
I'd be curious to hear what http server you prefer.
cyberax 17 hours ago [-]
Caddy for the reverse proxy and TLS termination. I don't have any more FastCGI-based services, but I think it can also host them.
What else? I'm also using Hickory for DNS. I replaced the stock OpenSSH with a version compiled using Fil-C.
gnunez 11 hours ago [-]
Strangely, Cox seems to think it’s a good idea to have these brokers running authenticated on their routers.
I hadn't heard of it, and thought to share it here. I'm not sure why people are upvoting it - but it's not impossible that others are interested in this topic as well..! Cheers
At the end we moved from a cluster to a single instance running on a over provisioned machine, that worked pretty well.
So we had our application talking to two nodes of a cluster, both working normally without talking to each other (nevermind the fact that the connectivity between the machines was fine). Some workers picked up jobs, others didn't. IIRC the app read requests from a queue and wrote replies to another one, so we'd have half of the jobs being picked up, and then half of the replies not being picked up (ergo, 75% of the requests failed). It was bizarre and nothing seemed to indicate there were issues with RabbitMQ itself. I don't even remember how we figured it out at the time.
It's been nearly 10 years, I'm sure that it's better, that I was inexperienced, that the original setup wasn't great. But that left me so sore on it that I have actively avoid it ever since.
Bonus points for having dealt with this while Django Celery apparently had two independent configuration mechanisms, and both were being used in this app. Fun times.
There are a bunch of options but the one I settled on is zigbee2mqtt, which requires a broker for message-exchange. Once it was setup it was pretty trivial to write simple clients to connect to the mosquitto instance and read/modify device state.
(e.g. I wanted something that would turn on my bedside light at 6am, and something else that would trigger some flashing lights when my laundry machine was finished and I did that via some external processes.)
brokerless is nice niche for when you have pretty constrained use case but just not traversing network well (zmq requires multipath for any sensible patterns) already roots many use cases out, as is the authentication
i picked mosquitto but had to ditch it for AWS IoT Core and have not looked back.
HA is a more difficult thing to solve, I believe Cedalo sell a version with HA support which may solve all this but the open source version doesn’t really have any good answers. The usual approach seems to be setting up topic replication between all your nodes and putting a load balancer in front.
Thankfully the system I’m responsible for can tolerate outages so we just work on the basis that we have regular snapshots and can stand up a new instance if the one handling traffic fails, with the fault tolerance sitting on the client side with messages being queued for transmission when the connection comes back.
[0] https://github.com/wind-c/comqtt/
[1] https://github.com/fhmq/hmq
I looked at MQTT options earlier last year, and the best one was Mochi ( https://github.com/mochi-mqtt/server ), written in Go.
I added TLS support with Let's Encrypt provisioning to it: https://github.com/Cyberax/lenc-mochi
For services that can't be avoided, I try to limit their exposure. I run Postgres with strictly controlled network access. Same for Redis.
What else? I'm also using Hickory for DNS. I replaced the stock OpenSSH with a version compiled using Fil-C.