Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Bridge with reloadable topics list

Dear all,

I am new to this mailing list, so I hope that I am not off topic -
apologies in case.

I'm working on a proof of concept application that would be using
Mosquitto as a bridge to an external MQTT broker. In this application, I
need to change the list of bridge topic dynamically (specifically,
outgoing topics).

I see that all the bridge options are plainly skipped when reloading 
the configuration file and I am exploring to understand how hard it
would be to - instead - make at least the list of topics updated at
SIGHUP. 

In conf.c I can see that it would be quite straightforward to regenerate
config->bridge[].topics; for outbound topics, I can see that that list
is directly used in _mosqutto_send_publish in lib/send_mosq.c while 
subscriptions for inbound topics are established at bridge connection
time - so I would need to remove old subscriptions and generate new ones.

What I wanted to ask you is what are the threading implications of
changing this list of topics at runtime. Apologies if this is an obvious
question, but I am not familiar with the mosquitto codebase in general
and especially with its threading architecture. For example, 
is _mosquitto_send_publish executed by a different thread than the 
one that updates the configuration? Could you point me to parts of code
(or docs) where I can see more about threading in mosquitto? 

Are there any other implications I am not considering of changing
the list of bridged topics at runtime?

Thanks a lot for your time and best regards,
Andrea



Back to the top