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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则