简体   繁体   English

是否可以将 MQTT 代理 mosquitto 桥接到 Cloud PubSub?

[英]Is it possible to bridge MQTT broker mosquitto to Cloud PubSub?

I have a local mosquitto broker that I would like to connect to Google Cloud pubsub queue.我有一个本地 mosquitto 代理,我想连接到 Google Cloud pubsub 队列。 I looked into Google Cloud IOT core but with no luck, I cannot seem to connect to it我查看了 Google Cloud IOT 核心,但没有运气,我似乎无法连接到它

Here is my mosquitto configuration这是我的 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

Is there a way to forward all the messages received from edge devices to Google Cloud Pubsub?有没有办法将从边缘设备收到的所有消息转发到 Google Cloud Pubsub?

After deeper research, it is not possible without the existence of a gateway device either virtually or physically.经过更深入的研究,没有网关设备的存在是不可能的,无论是虚拟的还是物理的。 It could even be client code running on same machine as the one running the broker.它甚至可以是与运行代理的机器在同一台机器上运行的客户端代码。

This usecase is however possible in AWS Iot https://wiki.seeedstudio.com/Arduino-AWS-IOT-Bridge/然而,这个用例在 AWS IoT 中是可能的https://wiki.seeedstudio.com/Arduino-AWS-IOT-Bridge/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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