0
votes

I am sending a message from a device to Azure IoT Hub with a set route to forward all device messages to Azure Service Bus. I noticed a bug where every first bokered msg Id on service bus is null. The following messages are fine with a valid msg Id.

Device code:

        var messageString = JsonConvert.SerializeObject("json msg");
        var message = new Message(Encoding.ASCII.GetBytes(messageString));
        _deviceClient = DeviceClient.Create(IotHubUri, new DeviceAuthenticationWithRegistrySymmetricKey(DeviceId, DeviceKey), TransportType.Amqp);
        await _deviceClient.SendEventAsync(message);

I suspect it is an issue in IoT side as testing without IoT (sending directly) works well. enter image description here

Any troubleshooting ideas?

This seems to be related: AMQP Message Null when using Azure IoTHub Routing

1

1 Answers

2
votes

your device should be populated a message id, for instance:

message.MessageId = "your message id";