Skip to content

ULID in MQTT message

0

Hi,

I am working with mqtt client. And I am using CPP implementation for that. I want to use ULID in one of my request message. I am not getting how to do it.

Can you please help me in that?

  • Can you describe how you wish to use the ULID in a request message, and if this is with MQTT 3.11 or MQTT 5 client connection?

2 Answers
0

Depending how you wish to process the payload, the ULID can be added as an additional key/value to the message (assuming JSON). For instance, the message payload could like this:

{
  "MyData": {
    "foo": 1,
    "bar": 2,
  },
  "ULID": "01GMB8RKEBSHA1081ZGTTRBD6B"
}

And the you can programmatically process the ULID by a subscriber, or inline via the Rules Engine if passing off to Lambda for instance.

AWS IoT Core does not have any features to introspect data, like for putting it into a CloudWatch Log entry. You would need to understand the message payload and use the ULID within your business logic.

Please let me know if you have any follow-ups!

AWS

answered 4 years ago

  • Hi Gavin_A,

    Thanks for your reply. I want to know if AWS provides any API for ULID generation?. If yes can you please tell me the API name. If no, how can I generate the ULID for C++ implementation?

    Regards, Hariom

  • ULID generation is non-vendor standard. Web search for ulid generation c++ example is probably a good starting point. AWS doesn't have any services that generate ULID or UUIDs.

0

Hi Gavin_A,

I want to use ULID as one of the element in the MQTT message.

I am using MQTT 3.11 for client connection.

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.