Handle AWS IoT Messages using AWS Lambda

   Go back to the Task List

  [« 5: Create IoT Rule ]    [7: Check IoT Messages »]

6: Publish Messages from the Device

The device and AWS IoT Core use publish-subscribe based communication model using topics. In this task, you use MQTT client which is part of AWS IoT Core to publish messages to iot/dojoinbound topic and due to the IoT rule configuration, the message will be sent to the Lambda function for processing.

  1. On the AWS IoT Core console, click on Test menu in the left to open MQTT client. Click on the Publish to a topic link.

    Inbound

  2. It moves to the publish topic part of the MQTT client, type in iot/dojoinbound as the topic name. Copy-Paste the message shown below and click on the Publish to topic button.

    {
      "temperature": 40,
      "vibration": 30,
      "pressure": 25
    }
    

    `

    Inbound

  3. The message is published to the AWS IoT Core. Due to IoT rule which is looking for the messages published to the topic iot/dojoinbound, the rule will pick the message and send the message to the Lambda function.

  4. Let’s check the message sent to the Lambda function in the next step.