Javascript Greengrass IPC subscribe to IoT Core - Error Subscribing to Topic.

0

While using the Javascript greengrass IPC client 'subscribeToIoTCore' I receive the following error in greengrass.log when the core device does not have an active internet connection.

2023-08-28T03:34:20.832Z [ERROR] (AwsEventLoop 2) com.aws.greengrass.mqttclient.AwsIotMqtt5Client: Error subscribing to topic. {clientId=Dev, topic=Iot/Dev-notifications-plugin/clientRequests}
java.util.concurrent.CompletionException: software.amazon.awssdk.crt.CrtRuntimeException: Mqtt5 operation failed due to a disconnection event in conjunction with the client's offline queue retention policy. AWS_ERROR_MQTT5_OPERATION_FAILED_DUE_TO_OFFLINE_QUEUE_POLICY(5156)
        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:632)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
Caused by: software.amazon.awssdk.crt.CrtRuntimeException: Mqtt5 operation failed due to a disconnection event in conjunction with the client's offline queue retention policy. AWS_ERROR_MQTT5_OPERATION_FAILED_DUE_TO_OFFLINE_QUEUE_POLICY(5156)

my node js app throws this RpcError:

 type: 8,
  description: 'Eventstream RPC request failed.  Check serviceError property for details.',
  serviceError: {
    message: "Subscribe to topic Iot/Dev-notifications-plugin/clientRequests failed with error java.util.concurrent.CompletionException: software.amazon.awssdk.crt.CrtRuntimeException: Mqtt5 operation failed due to a disconnection event in conjunction with the client's offline queue retention policy. AWS_ERROR_MQTT5_OPERATION_FAILED_DUE_TO_OFFLINE_QUEUE_POLICY(5156)",
    _service: 'aws.greengrass#GreengrassCoreIPC',
    _message: "Subscribe to topic Iot/Dev-notifications-plugin/clientRequests failed with error java.util.concurrent.CompletionException: software.amazon.awssdk.crt.CrtRuntimeException: Mqtt5 operation failed due to a disconnection event in conjunction with the client's offline queue retention policy. AWS_ERROR_MQTT5_OPERATION_FAILED_DUE_TO_OFFLINE_QUEUE_POLICY(5156)",
    _errorCode: 'ServiceError'
  }
}

Our IoT devices are regularly not connected to the internet due to being deployed in remote location.

Should this be handled and retried by Greengrass or should this be handled by our node app? The other option I was looking at was subscribing to the local topic and using the Mqtt bridge component to bridge from IoT to the local pub/sub which might handle the internet connectivity issues?

What is the recommended method in my use case?

질문됨 9달 전312회 조회
1개 답변
0
수락된 답변

subscribeToIoTCore won't be retried by Greengrass, your node app should handle retries. Bridge would work too, but it would add unnecessary complexity in this scenario.

AWS
답변함 9달 전
profile picture
전문가
검토됨 한 달 전

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

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

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

관련 콘텐츠