Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
What is a MountPoint and what is it used for? #533
What is a MountPoint and what is it used for?
I see it referenced in the docs, specifically on this page regarding ACLs:
but haven't been able to figure out what it is, what it is used for, or why i would want one.
If this information is in the docs somewhere PLEASE post a link to it as i haven't been able to find an explanation anywhere.
Thank you @Think7 for bringing to our attention that the doc is not helpful.
Normally, a VerneMQ broker hosts one single topic tree. This means that all topics are accessible to all publishers and subscribers (limited by the ACL's you configured, of course).
Also note that currently VerneMQ implements a very restrictive version of mountpoints, somewhat modelled after RabbitMQ's vhost concept. Other MQTT brokers might implement a different model of mountpoints.
Thank you! This is a great explanation.
I was considering running two separate brokers for security reasons. One that handles my applications communication between the different internal services and one that clients connect to. Mountpoints seem to solve this issue.
One other question:
I understand MQTT is a message broker that strictly handles pub / sub for real time data.
How is a situation handled where a client needs access to previous messages or historical data?
For example a chat application.
Let's say Client1 and Client2 are passing text messages on a topic. If Client2 disconnects and then joins back later, unless he has stored the conversation history locally, everything is gone. He will only have access to whatever new messages are sent.
The only MQTT specific solution I can think of is continually updating the topics retain message with the entire conversations history so that is sent when Client2 re subscribes. This feels very wrong though.
What about needing to select only specific parts of the conversation? Say within a specific date range. Or perform searches or other operations?
How should an application handle this case?
referenced this issue
Mar 19, 2019
After struggling to wrap my head around Erlang, and understanding how to pass the correct values with Lua, I have come up with the following blog post and code, to allow custom mountpoints from Lua & MongoDB. The code should be easily adjustable to MySQL / Redis / CockroachDB as it is mostly about the proper formatting of the return values.
For this purpose, I have modified mongodb.lua and it's auth_on_register function.
@larshesel I hope it is OK that I quote VerneMQ code to explain how it works for non-Erlang coders :-)
We added the explanation above to the documentation: https://docs.vernemq.com/configuring-vernemq/listeners#mountpoints. Let us know if you have any ideas for improving! Cheers!