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?

質問済み 8ヶ月前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
回答済み 8ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ