Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Device shadow service documents: "id" field is not documented. #16

Closed
leventov opened this issue Jun 12, 2020 · 3 comments
Closed

Device shadow service documents: "id" field is not documented. #16

leventov opened this issue Jun 12, 2020 · 3 comments

Comments

@leventov
Copy link

https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-document.html

At least $aws/things/+/shadow/update/documents topics should produce documents with "id" fields, but this is not documented anywhere.

@bobwatso-aws
Copy link
Contributor

Thanks for the feedback!

AWS IoT doesn't send an id field in a shadow document unless a device included one. The MQTT spec does not allow publishing to a wildcard topic so, in the wildcard subscription example you describe, the thing name would be included in the topics of update document response messages published by AWS IoT. You would use that to identify the thing from which the document originated.

I've tested this a couple of ways and haven't seen an id field in a shadow document. If you have seen this, could you provide an example, please?

Thanks, again, for the feedback!

@leventov
Copy link
Author

This is right, the id field appeared in lambda arguments serverless function had event defined as follows:

SELECT *, topic(3) as id from '$aws/things/+/shadow/update/documents'

It's where id was coming from.

@bobwatso-aws
Copy link
Contributor

Thanks for the reply.
I'm glad you were able to identify the source of the field.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants