Closed ymoreiratiti closed 1 year ago
Well, um, maybe. Since PnP is still in preview, it's questionable whether we should be special casing dt-subject.
If you look in some other later preview material, usually in helper samples, you would see this as $.sub
You would find that in 'c'. Note that 'c' ONLY supports MQTT. C sharp, much to my surprise, does seem to support what you want for HTTP.
So, why not utilize MQTT? You can use MQTT over websockets if you face firewall issues.
In my scenario, I have a cronjob who downloads the log and sends it line by line. Currently, I'm using MQTT and doing an iteration for each file line, but I believe using the batch will be more network optimized.
@ymoreiratiti I'm not understanding here.
What are your referring to when you say "batch"? How does "batch" interact with using HTTP?
@anthonyvercolano for batch i'm refering to sendEventBatch.
You can send multiple messages with one request.
Released
Context
Description of the issue
When using the HTTP transport layer, the message property "dt-subject" is transformed to "iothub-app-dt-subject". This makes the Azure Hub API ignore the subject and show the message as unmodeled data.
Code sample exhibiting the issue
Analysing the code I found the code block where all message properties is added to the header with the prefix iothub-app https://github.com/Azure/azure-iot-sdk-node/blob/26695213809ff87e3e052c8f82de3be3a8afc066/device/transport/http/src/http.ts#L177
The same appear to be happening with
sendEventBatch
. Check this file: https://github.com/Azure/azure-iot-sdk-node/blob/26695213809ff87e3e052c8f82de3be3a8afc066/device/transport/http/src/http.ts#L278I believe he should detect when the message property is dt-subject and ignore prefix, so the header should be only "dt-subject".