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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠