greengrass local mqtt brokers advice

0

Hello,

I understand that i can use (and am using) the base greengrass install to publish and subscribe to local mqtt topics. To publish and subscribe i need to use the aws-iot-sdk (c++) library.

  • is it possible to use a standard mqtt library to talk to this internal greengrass broker as well ? or do i need to use the aws-iot-sdk ?

I would like to use 1 broker to let all my greengrass components and external tablets talk to each other, so i would like to use it as a 'message bus'

I also found a aws.greengrass.clientdevices.mqtt.Moquette broker (which i assume is like mosquitto) that can be installed on a greengrass device. I assume i can talk to this broker with any mqtt client library (even the libmosquitto ?)

  • are these assumptions correct ?

how would i make the choice of which broker to use ? the internal greengrass topics or the extra moquette broker ? what is the idea behind having 2 types of brokers ?

kind regards, Tom

clogwog
已提问 2 年前813 查看次数
1 回答
1
已接受的回答

Hi Tom,

Greengrass only has a single MQTT broker which is optional, aws.greengrass.clientdevices.mqtt.Moquette. The "internal" broker which I believe you are referring to is accessed using Greengrass IPC calls subscribeToIotCore and publishToIotCore. These calls are IPC calls and are not using the MQTT protocol directly (there is no MQTT broker involved on the local Greengrass device for these calls).

When using the MQTT broker provided by Greengrass which is aws.greengrass.clientdevices.mqtt.Moquette, you can use any MQTT client not just the AWS IoT Device SDK.

You may use the component aws.greengrass.clientdevices.mqtt.Bridge in order to bridge data on topics between IoT Core, local MQTT (Moquette Broker), and Greengrass local pubsub (subscribeToTopic/publishToTopic).

AWS
专家
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则