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
demandé il y a 2 ans304 vues
1 réponse
0
Réponse acceptée

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
répondu il y a 2 ans
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions