Having worked with update and get operations, let’s try to delete the shadow document for the device.
-
On the AWS IoT Core console, click on the Test menu. You see the MQTT Client which you can use to publish and subscribe to the topics.
-
When you publish empty message to the $aws/things/dojodevice1/shadow/delete topic, AWS IoT core publishes the delete confirmation message to the $aws/things/dojodevice1/shadow/delete/accepted topic. If the delete fails, a message is published to the $aws/things/dojodevice1/shadow/delete/rejected topic.
-
You will add subscriptions for $aws/things/dojodevice1/shadow/delete/accepted and $aws/things/dojodevice1/shadow/delete/rejected topics in the same way you did earlier.
-
Next, publish empty message to the $aws/things/dojodevice1/shadow/delete topic.
-
The moment the message is published, you will see a green dot next to the $aws/things/dojodevice1/shadow/delete/accepted topic. It means there is a new message published to this topic.
-
Click on the $aws/things/dojodevice1/shadow/delete/accepted topic to check the message which shows the version and timestamp of the shadow document deleted.
-
You can verify the delete by looking at the shadow document for the device. As mentioned in the task-2, open the details for the device dojodevice1 and goto the Shadows menu to check the shadow document of the device.
Before delete
After delete
-
That finishes the workshop. You worked on all three operations - update, get and delete. Please go to the next step to clean the resources so that you incur no cost after the workshop.