简体   繁体   中英

MQTT topic transform in Mosquitto

I'm working on integrating a Shelly sensor( https://shelly.cloud/ ) into an existed IoT system FIWARE( https://www.fiware.org/ ). The sensor can publish the monitoring data via MQTT with JSON payload.

Shelly sensor published the data at topic {SHELLY_ID}/events/rpc , but the FIWARE can only subscribe on topic /json/{{api-key}}/{{device-id}}/attrs . The topic of publication and subscription are different now. In our application, we use Mosquitto as an MQTT broker, is it possible to do the topic transform in Mosquitto broker?

I think Mosquitto has full knowledge of topics and can do the topic mapping and transformation easily. Does anyone have an idea or information for this? I think it's much easier than to re-build and customize the FIWARE system.

Mosquitto does not support generic topic remapping.

The only place it has any support is

  1. Adding a prefix when mapping topics over a bridge
  2. Adding a prefix as a mount point for a listener

The simplest way to solve this problem is to write a client to do the remapping

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM