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
已提問 2 年前檢視次數 304 次
1 個回答
0
已接受的答案

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
專家
Greg_B
已回答 2 年前
  • 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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南