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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南