Hi community!
I am new to MQTT and I am playing with the broker to try to understand how things work.
I have found an issue using mosquitto 2.0.17 running on linux (debian bullseye)
I have set a testing environment on VMs using KVM and started the broker. The basic configuration worked well, but when I try to tweak it a bit I found some odd behavior.
If I set per_listener_settings true and restart the service mosquitto fails with the error code "Error: Address already in use"
I have checked if the port is still being used using netstat and if there is another instance of mosquitto runing but there is nothing there.
The port is available according to netstat
root@MQTT-Server:~# netstat -anpe | grep "1883" | grep "LISTEN"
root@MQTT-Server:~#
And there isn't any other mosquitto instance running according to ps.
root@MQTT-Server:~# ps -aux | grep mosqui
root 37606 0.0 0.0 6240 708 pts/1 S+ 11:43 0:00 grep mosqui
root@MQTT-Server:~#
My mosquitto.conf file is:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.gz
pid_file /run/mosquitto/mosquitto.pid
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
per_listener_settings true
allow_anonymous false
password_file /etc/mosquitto/mosquitto.passwd
persistence true
autosave_interval 60
retain_available true
listener 1883 192.168.100.10
socket_domain ipv4
allow_anonymous false
max_inflight_messages 1
#This will guarantee in-order message delivery (maybe needed to locks)
max_queued_messages 5
#The queue size
If I comment the line per_listener_settings true
the service starts working again.
I also checked this using eclipse-mosquitto docker image. I found the same issue.
Am I doing something wrong?
Thanks in advance
Ezequiel