我正在尝试仅使用 docker-compose 创建 EMQ X 桥接设置(MQTT 桥接)。作为参考,我正在查看官方文档。我想到的用例是将EMQ X Edge ( emqx-edge
) 桥接到 EMQ X( emqx
),然后当消息发布到它时,emqx-edge
它会被转发到emqx
。到目前为止,我已经创建了两个代理和一个网络,因此它们可以通信(poc-bridge)。
问题是:当一条消息发布到一个主题(例如sensor1/#
)给emqx-edge
代理时,它永远不会到达emqx
代理。我不知道出了什么问题..
Bellow 是我目前拥有的 docker-compose。
version: '3.3'
networks:
poc-bridge:
external: true
services:
mqtt-edge:
image: emqx/emqx-edge:latest
container_name: edge-broker
restart: always
environment:
- EMQX_LOADED_PLUGINS= "emqx_bridge_mqtt"
- EMQX_ADMIN_PASSWORD=brokerpw1
- EMQX_BRIDGE__MQTT__AWS__ADDRESS=172.26.0.2:1883 #ip:port of mqtt-cloud
- EMQX_BRIDGE__MQTT__AWS__PROTO_VER=mqttv3
- EMQX_BRIDGE__MQTT__AWS__BRIDGE_MODE=true
- EMQX_BRIDGE__MQTT__AWS__CLEAN_START=true
- EMQX_BRIDGE__MQTT__AWS__USERNAME=user
- EMQX_BRIDGE__MQTT__AWS__PASSWORD=passw
- EMQX_BRIDGE__MQTT__AWS__CLIENTID=bridge_aws
- EMQX_BRIDGE__MQTT__AWS__KEEPALIVE=10s
- EMQX_BRIDGE__MQTT__AWS__FORWARDS=sensor1/#
networks:
- poc-bridge
ports:
- 18083:18083
- 1883:1883
- 8883:8883
- 8083:8083
depends_on:
- mqtt-cloud
mqtt-cloud:
image: emqx/emqx:latest
container_name: cloud-broker
restart: always
networks:
- poc-bridge
ports:
- 51883:1883
- 58883:8883
- 58083:8083