How can I retrieve the UUID of the inserted record?

Hey guys @IoT Cloud i have devices that collect few samples each week, storing the data indefinitely. Using AWS IoT, I’ve connected the devices to IoT Core and can publish/subscribe via MQTT. A rule forwards payloads to an HTTP endpoint, which inserts records into an RDS database and returns a UUID.

Previously, I sent JSON directly to the HTTP endpoint, received the UUID, and stored it with the sample on the device. However, with MQTT, I can’t receive the UUID back. The response only includes the original message. How can I retrieve the UUID of the inserted record? If this approach is incorrect, what alternative should I consider?
Solution
To retrieve the UUID of the inserted record, consider these options:

  1. Use AWS Lambda to process the message and return the UUID.
  2. Implement a callback mechanism to store and retrieve UUIDs.
  3. Use a correlation ID to match responses with original messages.
Was this page helpful?