IoT, result of ShadowTopicPrefix/update

0

The documentation says that when I publish a request state document to the /update topic, "AWS IoT responds by publishing to either /update/accepted or /update/rejected".

I don't always need the response, and often I am not even subscribed to the update/accepted or update/rejected topics. Is this a problem? I think it depends on what QoS level is being used to send the response. I don't see that documented anywhere.

If I do subscribe to the /update topics in the future, I don't want to get all of the update messages that I ignored earlier, just new ones that come in after that. How do I make sure this happens?

Also, I'm not entirely clear as to whether it's OK for a single MqttClientConnection to subscribe to more than one topic (I am using the Java class from the AWS Java SDK). Is the handler called back on the same thread that created the subscription, and does this matter?

  • Also, I can't figure out why I'm not getting any responses on /update/accepted or /update/rejected even if I do subscribe to them. Are these responses automatically generated by IoT, or do they depend on the device itself sending a response?

Frank
posta 4 mesi fa145 visualizzazioni
1 Risposta
0

You don't necessarily need to subscribe to updated/accepted or update/rejected. But QoS won't help you if the result of the update is that the update was rejected. You wouldn't know.

You can subscribe to more than one topic. Please refer to the SDK's shadow sample: https://github.com/aws/aws-iot-device-sdk-java-v2/blob/main/samples/Shadow/src/main/java/shadow/ShadowSample.java#L242. (I think you mean the AWS IoT Device SDK V2).

profile pictureAWS
ESPERTO
Greg_B
con risposta 4 mesi fa
  • Thanks for the response. I was concerned that by not subscribing, a whole bunch of messages would pile up and cause problems. In our situation we have a lot of devices and don't really expect many rejections, so the overhead of subscribing to all those topics isn't worth it.

    I do need the update/accepted topic to work for a limited number of devices (basically, ones where my end user actually has our app open at that moment). This used to work, but for some reason it is behaving oddly. I do not receive the expected responses. However if I later unsubscribe and resubscribe, I sometimes get a whole slew of old responses all at once.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande