Shahab Intezari
Shahab Intezari

Reputation: 85

Stop Mosquitto from sending the message to its owner(sender)

At the moment mosquitto send the received message to whoever that is subscribed to the topic, even the sender of the message. Is it possible to stop the mosquitto from sending the message to its owner?

Upvotes: 2

Views: 2651

Answers (3)

xryl669
xryl669

Reputation: 3584

If using MQTT v5.0, you can set the No Local flag at subscription time for the subscription option. This flag tells the broker not to send an application message received with a client ID to a subscriber with the same client ID, which is exactly what you are expecting here.

This is not available in MQTT v3.1.1 unfortunately.

Upvotes: 4

Shahab Intezari
Shahab Intezari

Reputation: 85

Unfortunately there is no easy straightforward solution to this. However it is possible with Mosquitto broker. I needed to download the source code and change the underlying codes and compile it again. It requires moderate knowledge of C programming. I need to study the code behind the broker and understand how it works. A bit hard and time consuming but possible.

Upvotes: -2

hardillb
hardillb

Reputation: 59618

No, this is the correct behaviour according to the MQTT spec

Upvotes: 1

Related Questions