【问题标题】:Is it possible to bridge MQTT broker mosquitto to Cloud PubSub?是否可以将 MQTT 代理 mosquitto 桥接到 Cloud PubSub?
【发布时间】:2020-12-13 02:48:11
【问题描述】:

我有一个本地 mosquitto 代理,我想将它连接到 Google Cloud pubsub 队列。 我查看了 Google Cloud IOT 核心,但运气不好,我似乎无法连接到它

这是我的 mosquitto 配置

#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/


# Goolge IoT Core Configuration

connection bridge-to-gcp

address mqtt.googleapis.com:8883

bridge_attempt_unsubscribe false
bridge_certfile /Downloads/rsa_cert.pem
bridge_keyfile /Downloads/rsa_private.pem
bridge_cafile /Downloads/roots.pem
bridge_protocol_version mqttv311
bridge_insecure false

tls_version tlsv1.2
try_private true

start_type automatic
cleansession true
notifications false

local_clientid local-to-remote-gcp-bridge

remote_clientid projects/toolsense-dev/locations/europe-west1/registries/test-registry/devices/test-device

topic # both

有没有办法将从边缘设备收到的所有消息转发到 Google Cloud Pubsub?

【问题讨论】:

标签: mqtt google-cloud-pubsub mosquitto google-cloud-iot


【解决方案1】:

经过深入研究,如果没有网关设备,无论是虚拟的还是物理的,都是不可能的。它甚至可以是与运行代理的机器在同一台机器上运行的客户端代码。

然而,这个用例在 AWS IoT 中是可能的 https://wiki.seeedstudio.com/Arduino-AWS-IOT-Bridge/

【讨论】: