Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto_id_prefix behaves inconsistently based on host port mapping in Docker #3186

Open
hn05012 opened this issue Dec 8, 2024 · 0 comments
Open
Labels
Status: Available No one has claimed responsibility for resolving this issue.

Comments

@hn05012
Copy link

hn05012 commented Dec 8, 2024

I am experiencing an inconsistency in the behavior of the auto_id_prefix configuration. When running Mosquitto in Docker, the prefix is applied to server-assigned client IDs only when the host port mapped to the container's port 1883 is not 1883. If the host port is 1883, the client IDs are prefixed with auto- instead of the specified prefix.

Steps to reproduce:

  1. Define a docker compose file:

services:
mosquitto-1:
image: eclipse-mosquitto:latest
ports:
- 1883:1883
- 8883:8883
- 9001:9001
volumes:
- ./mosquitto/mosquitto_1/mosquitto_1.conf:/mosquitto/config/mosquitto.conf

mosquitto-2:
image: eclipse-mosquitto:latest
ports:
- 1884:1883
- 8884:8883
- 9002:9001
volumes:
- ./mosquitto/mosquitto_2/mosquitto_2.conf:/mosquitto/config/mosquitto.conf

mosquitto-3:
image: eclipse-mosquitto:latest
ports:
- 1885:1883
- 8885:8883
- 9003:9001
volumes:
- ./mosquitto/mosquitto_3/mosquitto_3.conf:/mosquitto/config/mosquitto.conf

  1. configure the brokers:

listener 1883
auto_id_prefix
allow_anonymous true

  1. Start the containers

  2. Connect a client with empty client id:

  • Host port 1883
  • Host port 1884
  • Host port 1885

Expected Behavior:
The auto_id_prefix should consistently apply the specified prefix regardless of the host port mapping.

Actual Behavior:
When the host port is mapped to 1883, the prefix defaults to auto-

@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue.
Projects
None yet
Development

No branches or pull requests

1 participant