SDK version used: 1.42.2 (but also inspected the source of the latest main commit)
Description of the issue
The bug is almost exactly the same as described in #3201, but for me it happened with SendEventBatchAsync.
Sending a message to multiple outputs, or multiple times throws the following exception:
An item with the same key has already been added. Key: iothub-outputname
Looking at the source it seems that the fix (using the indexer to set the property) for #3201 was only applied to the SendEventAsync method. The method SendEventBatchAsync still uses .Add() and throws.
Would be great to fix it there too, I'm currently using reflection to remove the key before I call the ModuleClient - which is obviously not very pretty :-/
Context
Context is very likely irrelevant
Description of the issue
The bug is almost exactly the same as described in #3201, but for me it happened with
SendEventBatchAsync
.Sending a message to multiple outputs, or multiple times throws the following exception:
An item with the same key has already been added. Key: iothub-outputname
Looking at the source it seems that the fix (using the indexer to set the property) for #3201 was only applied to the
SendEventAsync
method. The methodSendEventBatchAsync
still uses.Add()
and throws.https://github.com/Azure/azure-iot-sdk-csharp/blob/9e445ce1e817c225758d7a351974848b7259788c/iothub/device/src/InternalClient.cs#L1573
Would be great to fix it there too, I'm currently using reflection to remove the key before I call the ModuleClient - which is obviously not very pretty :-/
Thanks in advance