3
votes

When using the AWS Java SDK (aws-java-sdk-iot) it is possible to publish messages to an AWS IoT topic from a backend system, but it doesn't seem possible to subscribe to a topic? What is the reasoning behind this?

We are looking for a way to have our Java backend (deployed on AWS) take part in our IoT solution and being able to publish and subscribe to topics. If using the sdk is not the way to go, what would be a good design to achieve this?

We do not want to use the AWS Device SDK for this.

1

1 Answers

0
votes

The non-device SDKs for IoT are request/response oriented and use the HTTP protocol. It would be a weird API (see the SQS API) if it held open an HTTP request until a message arrived on a subscription.

The AWS Device SDK is not a bad choice, but you could avoid using it by doing the same thing it does and set up a persistent connection to the broker using MQTT or MQTT + WebSocket.

If you decide to roll your own MQTT client, using Netty and its MQTT codec would be a reasonable place to start.