Open satel-kalletuulos opened 1 week ago
since per-listener settings is true, perhaps adding plugin /usr/lib/mosquitto_dynamic/sample_plugin.so
to the 1883 listener helps?
It does not help. The plugin is called only for messages sent through that specific listener.
Mosquitto version: 2.0.18 Target environment: Yocto 4.0 (Kirkstone)
The device A running Mosquitto broker establishes bridge to device B. Purpose is to create a plugin to modify messages received through bridge.
I'm experimenting with the sample plugin from Mosquitto repository: https://github.com/eclipse-mosquitto/mosquitto/blob/v2.0.18/plugins/payload-modification/mosquitto_payload_modification.c
I added debug print to callback_message function so I can see, when that message is called, as follows:
System's
/etc/mosquitto/mosquitto.conf
file is as follows:On
/etc/mosquitto/conf.d
directory, there are following configuration files:01-defaults.conf
- contains just rowper_listener_settings true
10-listener-all.conf
- contains definitions for the default listener, currently following:20-default-bridge.conf
- contains following:30-sample-plugin.conf
- contains following:Notice that the plugin configuration file has to have additional listener, as otherwise it would open default listener for port 1883 and it would conflict for the existing listener.
For testing and debugging, Mosquitto broker is started with command line:
mosquitto -c /etc/mosquitto/mosquitto.conf
From debug prints, it can be seen that the sample plugin is not called for messages arriving through bridge or for messages arriving from default listener on port 1883. Plugin is called only for messages arriving from port 1884.Question: How can plugin be configured so that it would called for ALL messages, arriving from all ports and also from bridge?