aws.greengrass.ipc.pubsub clarification

0

Overview

I started using aws.greengrass.ipc.pubsub for Greengrass components to communicate with each other (i.e. 1 component publishes and 1 component subscribes within a single Greengrass core device) and have a few questions.

Questions

  1. Do I need any AWS-provided components to leverage "pubsub"? Or is pubsub built-in with Greengrass V2 (i.e. it's part of the Nucleus or something)? For instance, I am a bit confused about whether I need to add a component like aws.greengrass.clientdevices.mqtt.Bridge to my deployments for pubsub rules to work. I did add this, but am not sure if it was necessary and haven't tried without yet.
  2. Generally speaking, what underlying transport mechanism does aws.greengrass.ipc.pubsub use? When using it, the implementation seems somewhat memory and CPU intensive compared to an MQTT broker like mosquitto. For instance, I have observed a couple java "Out of Memory" errors and needed to restart the Greengrass Nucleus when sending bursts (5-10 messages, ~8 MB each) through the pubsub topics.
  3. This may be answered with question #2, but I assume there is no way to use off-the-shelf tools (like mosquitto_pub) to connect and send messages to the pubsub topics. Communication can only be done from properly "registered" Greengrass components and SDK calls. Is that correct?
ttnickb
질문됨 8달 전280회 조회
1개 답변
1
수락된 답변
  1. Pubsub is part of Nucleus. The documentation always tells you what requirements there are, if any: https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-publish-subscribe.html. MQTT bridge component is only useful when you have client devices connecting to a local Greengrass broker.
  2. Pubsub is implemented on top of eventstreams in C, you can see the implementation is opensource: https://github.com/aws/aws-iot-device-sdk-java-v2. If you are running out of memory then something is pretty wrong. Did you configure Greengrass Nucleus with a maximum java heap size? 8MB is generally very large for messages, it can certainly work if you have enough memory free on the device and allocated to Greengrass's Java, but I'd recommend you do not do bulk data transfer using pubsub. You may instead use pubsub to communicate enough information to then setup a high speed direct transfer mechanism between your components. eg: gRPC, memory mapped files, etc.
  3. Greengrass IPC communication requires authentication and authorization, no external component can connect to Greengrass. The Greengrass local CLI supports publishing and subscribing and the Local Debug Console also supports this.
AWS
전문가
답변함 8달 전
profile pictureAWS
전문가
검토됨 8달 전
profile pictureAWS
전문가
Greg_B
검토됨 8달 전
  • Thanks so much for the quick response and links!

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

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

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

관련 콘텐츠