- Newest
- Most votes
- Most comments
The main AWS SDK for Java includes a client for interacting with the control plane APIs of AWS IoT Core, such as ListThings and DescribeEndpoint as you have found. It also includes some limited functionality for the data plane, such as publishing a new message over the HTTP API and GET/POST APIs for interacting with the device shadow service. If you are looking for full bi-directional pubsub, you may want to use the AWS IoT Device SDK for Java: https://github.com/aws/aws-iot-device-sdk-java-v2
I'm confused as to how to construct the AwsIotMqttConnectionBuilder. It seems to require a certificate and a private key. I have an AWS access key and secret key. How do I convert that into the credentials that this class requires?
I should add that what I'm trying to do is create a Java server application that can access all of my devices simultaneously. I know that individual devices have certificates, but I'm not trying to emulate a device, I'm trying to build a supervisor application that can receive and send messages from and to any device. Is this even possible?
Yes, that is supported. If your server app has AWS IAM AK/SK to use, you want to connect your app using MQTT over websockets instead of x509 certificate. If you use the withWebsockets() flag on AwsIotMqttConnectionBuilder, I believe it will default the CredentialsProvider to use system env AK/SK. You can override and provide your own CredentialsProvider using withWebsocketCredentialsProvider().
Thanks for the response. I'm lookin at the AWS IoT Device SDK, but immediately running into the issue that the classes it uses, such as "software.amazon.awssdk.crt.CRT", are not recongized when I try to import them into my project. Do you know which Gradle packages I need to include to get them?
Relevant content
- asked 6 months ago
- asked a year ago
- asked 3 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
Which functions allow me to interact with the device shadow service? Are these functions of IotClient, or something else?
Java SDK separates the data plane commands into a separate client: https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/iotdataplane/IotDataPlaneClient.html