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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인