Duplicate message in multi server configuration
I'm trying to setup multi servers for mosquitto to provide push notification service for Android devices.
Basic requirements were as follows.
1) Each Android device has a unique id
2) Each message that couldn't be delivered should be queued and be delivered later when network connection is available.
So I set 'clean session' to false and used unique android id as a client id, and set QoS to 2 for future delivery.
This worked perfectly in single mosquitto server configuration, but in multi server configuration, it didn't.
I used haproxy on top of two mosquitto servers as a load balancer, and made a bridge between those mosquittos.
But in case described below, a client get duplicate messages.
1) a client connected to server 1
2) after disconnection, then the client connected to server 2
3) a push message published and the client received it from the server 2
4) after another disconnection, the client connected again to server 1 and receives duplicated message.
Current bridge configuration is as follows.
-Server 1
connection abvje_push_1
address 192.168.0.23:1883
topic notification/AAAA/# both 2
clientid abvje.32
cleansession true
keepalive_interval 60
start_type automatic
restart_timeout 30
try_private true
username bridge
password xxxxxxxxxxxxx
Server 2 has no special configuration for bridging.
Is there a way to solve this kind of problem?
Any kind of advice will be appreciated.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- mosquitto Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Roger Light
- Solved:
- Last query:
- Last reply: