I have Mosquitto installed on Windows 8 and I am trying to write Paho clients in Java to understand MQTT. I wrote a blocking publisher and a client subscriber. I created two threads of the subscribing client with different client ids. When I publish one message with QoS 2, both the clients receive the message. I am expecting exactly one client to receive the message. Is my expectation wrong?
I felt I didn't program to the API correctly and wanted to troubleshoot with mosquitto_pub and mosquitto_sub. Same result. Both the subscribers received the message. Please check the screenshot here: https://i.stack.imgur.com/9bfUx.jpg
I am pretty sure that I am doing something wrong but I am not able to pinpoint it. All mosquitto.conf properties are set to default. Any help would be appreciated. I have exhausted half a day on this already. :(