Use Local MQTT Broker With AWS Greengrass Component

0

I have an existing component that uses both Greengrass IPC messages, and MQTT messages, to communicate to other local components (via IPC) and AWS cloud (MQTT).

I now need to enable a messaging integration with a non-Greengrass Docker running on the same device. I was thinking of using MQTT messaging from the Greengrass Docker image, and implementing Greengrass between the two.

Could someone suggest a way of implementing this, where I could use existing AWS Greengrass resources to implement a local MQTT publisher, such that a non greengrass container can implement an MQTT subscriber and receive those messages ?

已提問 10 個月前檢視次數 435 次
2 個答案
0

About the question for bridging IPC to EMQx MQTT broker, yes, you can use the MQTT Bridge component for that as you indicated. For sending pubsub messages, not sure why you would want to use greengrass-cli, please use the PubSub APIs: https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-publish-subscribe.html#ipc-operation-publishtotopic Note that the MQTT client subscriber on the non-greengrass docker image needs to be registered as an IoT Thing.

已回答 10 個月前
  • Thanks for the answer. With regards to the greengrass cli pubsub, that's just for initial testing, we will use the pubsub APi's for the final version.

    is it possible to implement the MQTT subscriber on the non-greengrass image, while not as in IOT Thing ? Or does greengrass only support sending messages via MQTT to IoT Things.

  • Correct, at this time, MQTT subscriber (non-greengrass image) must to be registered as an IoT Thing.

0

Follow-Up Clarification:

I would like to receive local messages, inside a docker container, from Greengrass. This docker container runs entirely separately and is not greengrass related, though it runs on the same device as greengrass.

What I am trying:

  • MQTT subscriber in the non-gg container (using paho mqtt in python)
  • In Greengrass:
    • Greengrass MQTT broker (EMQX) component
    • Greengrass MQTT Bridge component (configured with src: Pubsub and target: LocalMQTT)
    • Sending pubsub messages with greengrass-cli pubsub

Am I way off in my approach ? Is it possible to bridge in this way, gg IPC messages to EMQX MQTT broker ?

已回答 10 個月前

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

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

回答問題指南