Skip to content

[Event Hubs] How can I check the message size when using Azure IoT Hub? #16969

@Marusyk

Description

@Marusyk

Query/Question
I'm using standard IoT Hub SDKs to read messages from built-in endpoint of IoT Hub.

How can I get a full message size for analytics? I mean not only Data size (see code) but a full message size with properties.
Size that actually counted by IoT Hub.

    private async Task ProcessMessage(ProcessEventArgs eventArgs)
    {
        string equipmentNumber = eventArgs.Data.SystemProperties["iothub-connection-device-id"].ToString();
        string message = Encoding.UTF8.GetString(eventArgs.Data.Body.ToArray());
        int bodySize = message.Length;

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageEvent Hubscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions