IoT topic names?

0

I'm trying to build a Java client that subscribes to IoT services topics.

In the IoT console, I went to the MQTT test client and subscribed to a topic named "test".

In my Java code, I set up an MqttClientConnection. For the endpoint, I gave the value returned by IotClient.describeEndpoint(). I also gave my AWS credentials.

I'm able to instantiate the client, connect, and publish a message to the "test" topic without encountering any exceptions. However, the message doesn't appear in the AWS console. Similarly, I can subscribe to the topic, but messages I publish via the console don't show up in the Java application.

I suspect the problem is that the topic name is not simply "test", but some string that has a prefix which associates it with IoT services. I can't find any documentation to this effect, though.

Thanks, Frank

Frank
asked 2 years ago293 views
1 Answer
0
Accepted Answer

I suspect the problem is that the topic name is not simply "test", but some string that has a prefix which associates it with IoT services. I can't find any documentation to this effect, though.

Hi Frank. There is no prefix, so something else must be going on. You can both publish and subscribe within the console's MQTT client to confirm this.

Could it be that your Java client has connected to the endpoint for a different region?

profile pictureAWS
EXPERT
Greg_B
answered 2 years ago
  • Thanks, it turned out I had an authentication problem that I didn't notice because I wasn't waiting for the connection to complete. Once I did that, I could see what was wrong and when I fixed it, the queues worked as I was expecting.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions