Close Greengrass IPC Pub/Sub Subscription with C++ SDK

0

Hello,

I am trying to implement a Request / Response communication pattern on top of Greengrass IPC's Pub/Sub API. The basic design is as follows:

  • The client process generates a unique ID for its request
  • The client process subscribes to a specific topic dedicated to responding to the request, such as ipc/upload/response/<request ID generated in step 1>
  • The client process makes a request to the server process at a specific topic, such as ipc/upload/request
  • The server process processes the request and publishes the response on the response topic
  • The client process reads the response on the response topic and unsubscribes / cleans up the response handler

I want to do the unsubscribe and clean up as there may be many requests and it does not seem to leave a number of handlers allocated after they have handled the single message they are intended to. However, I am not seeing anything in the GreengrassCoreIpcClient API docs about how to unsubscribe from a local pub/sub topic. How should I go about this?

질문됨 일 년 전287회 조회
1개 답변
2
수락된 답변

To unsubscribe, call close() on the subscription operation. For example: https://aws.github.io/aws-iot-device-sdk-cpp-v2/class_aws_1_1_greengrass_1_1_subscribe_to_configuration_update_operation.html. See "Public Member Functions inherited from ClientOperation"

Cheers,

Michael

AWS
전문가
답변함 일 년 전
profile pictureAWS
전문가
검토됨 일 년 전
  • Amazing, that answers my question. Thank you!!

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

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

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

관련 콘텐츠