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?

demandé il y a 9 mois312 vues
1 réponse
0
Réponse acceptée

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
répondu il y a 9 mois
profile picture
EXPERT
vérifié il y a un mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions