← Back to team overview

mosquitto-users team mailing list archive

Re: How to avoid loopback publish

 

Hi Fabio,

You can set the most significant bit of the protocol version number to
a 1 to indicate to the broker that you are a bridge. This prevents
your own messages being returned to you and also means that the
message retained status is propagated to you.

However, I would suggest that you reconsider your application design
instead. Perhaps your client should be listening on a different topic
than the one it is publishing on. The above behaviour is not part of
the MQTT spec and so should not be relied on being in all server
implementations.

Regards,

Roger

On Tue, May 21, 2013 at 10:06 AM, Fabio Di Bernardini <fdb@xxxxxxxxxxxx> wrote:
> Hi,
>
> I did a test with Mosquitto and Python client lib: in the same client I make
> a subscription to "/a/topic" then publish something to the same topic.
> Duly I received the publish just sent.
> But i don't need this.
> Is there a config trick in Mosquitto to avoid this "loopback publish"?
>
> --
> Fabio Di Bernardini <fdb@xxxxxxxxxxxx>
> Altraqua di Fabio Di Bernardini
> Via Preturo 12/C
> 67100 - Coppito (AQ) - ITALY
> www.altraqua.com
> Tel.: (+39) 08621956055 - (+39) 08621965586
> Fax:  (+39) 08625545115
> skype: altraqua
> gtalk: fabio.dibernardini
> www.twitter.com/fabdib
> www.facebook.com/fabiodib
>
> --
> Mailing list: https://launchpad.net/~mosquitto-users
> Post to     : mosquitto-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mosquitto-users
> More help   : https://help.launchpad.net/ListHelp
>


References