You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A neat feature of docker is to run inspect to get the ip address of the container (given the name arg from above):
docker inspect mqtt
Configuration
Depending on the startup method you would either place it relative to where the docker container is started, when using package manager the default path is /etc/lib/mosquitto
Forwarding the TCP traffic through socat can be used to simulate offline state, however, if you are using database and gracefully exit the broker it should write clients to database and clients can then regain session(of course depending on configuration). Example of using socat with docker based mosquitto server running at 172.18.0.2:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Starting
Using package manager
Either use system mosquitto package and init system, example:
Using docker
A neat feature of docker is to run inspect to get the ip address of the container (given the name arg from above):
Configuration
Depending on the startup method you would either place it relative to where the docker container is started, when using package manager the default path is
/etc/lib/mosquitto
Minimal config example
A non secure config example,
mosquitto.conf
:Simulating offline state
Forwarding the TCP traffic through
socat
can be used to simulate offline state, however, if you are using database and gracefully exit the broker it should write clients to database and clients can then regain session(of course depending on configuration). Example of usingsocat
with docker based mosquitto server running at172.18.0.2
:Clients can then connect to localhost:1234
Debugging database
Make a debugging database executable,
Of course you need to point to your instance of database file.
Wireshark
Install it with your package manager and add your user to the wireshark group, example:
If you are using docker than the traffic is only on that interface (given that you are not running other containers).
TODO move to repository readthedocs
Move this later to repo
Beta Was this translation helpful? Give feedback.
All reactions