0
votes

I have a few questions to the aws iot solution:

I want to register a "Thing" with a few attributes and a associate a client certificate to the thing.
Can I do this with the java sdk? Maybe you have a link to an example?
(didn't find that in the aws-iot-device-sdk, have only seen aws cli examples)

If a device (with the client certificate) publishes a message, how could I use the associated thing and its attributes? (In an action or a rule)
See only to get the shadow-device, but not the "thing":
http://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-functions.html#iot-sql-function-get-thing-shadow

Anybody could help me?

Regards,
Markus

1
regarding your 2nd question. Why do you need to access attributes in your rules? Maybe a topic hierarchy like things/typeOfThing/thingId/typeOfData could help?hellomichibye
I want to use these "Thing" attributes for use in actions (like Dynamo Save Action). Because these attributes are not sent by device, but are needed to store the payload in the table. Workaround would be, to call a lambda for each message, get the attribute value from a master data table in a database, and then store the record in dynamo, Example: Thing: Bike1 {attributes: "teamid":"4711"} MQTT Message: Topic: bike/Bike1 payload={gps data} Dynamotable: teamid, bikeid, gpsdata -> so I need the teamid from the thing attributesmananana

1 Answers

3
votes

Looks like, that's not possible:
https://forums.aws.amazon.com/thread.jspa?messageID=716981&#716981

So, an approach could be, to send the message to a lambda and use there the sdk to fetch the "thing" and its attributes. (with the describeThing method)

The first part of my Question is possible with the sdk.
http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/iot/AWSIotClient.html

Regards, Markus