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

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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ