Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.19k forks source link

Event hub consumer receives full desired properties on change of a single desired property on cloud #26063

Closed amit12cool closed 1 year ago

amit12cool commented 1 year ago

Describe the bug I have a event hub consumer in typescript with blob check point store. On changing or adding a new property in desired twin from cloud I get the full desired property object on my event hub consumer client.

For example:-

Lets say we add test key in desired property from cloud.

desired: {
"test":"123", // this is added
"test2": "456"
}

The event received on event hub consumer client is as below:-

desired: { "test":"123", "test2": "456" }


**To Reproduce**
Steps to reproduce the behavior:
1.  Subscribe to twin change events from iot hub to event hub endpoint.
2. Change desired property of a device in cloud.
3. Observe full device desired properties event is received on the event hub consumer client.

**Expected behavior**
Only the changed desired property data should be received in the vent hub consumer client event i.e.

desired: { "test":"123", }

amit12cool commented 1 year ago

@deyaaeldeen @jeremymeng any update on this?

deyaaeldeen commented 1 year ago

@amit12cool Thanks for filing this issue. Do I understand it correctly that your question is about using IoT Hub with Event Hubs?

@xirzec Do you know who from IoT Hub could help here?

amit12cool commented 1 year ago

It's setting the message routing with a filter condition to receive twin change event based on a property change in desired properties of twin in iot hub.

I expect that the twin property that I changed on iot hub should only be received on my event hub but I get the full desired properties on my event hub.

xirzec commented 1 year ago

Assuming we're talking about @azure/arm-iothub, perhaps @qiaozha has some idea of who the service team owners are?

deyaaeldeen commented 1 year ago

Thanks @xirzec!

@amit12cool Also, feel free to open a support ticket on Azure portal for this issue but as far as I can tell, this is not an Event Hubs SDK issue. I could be wrong though but let's see what the folks in the IoT Hub service team will have to say.

amit12cool commented 1 year ago

@qiaozha any update on this?

github-actions[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @kasun04 @saglodha.

qiaozha commented 1 year ago

@amit12cool could you help provide more information on which iothub library you are using? is this @azure/arm-iothub? but I feel like it should be a data plane library, also client side doesn't have any ability to know what the other value might be if the service side doesn't return it. I added the service attention label now.

amit12cool commented 1 year ago

@qiaozha I'm using https://www.npmjs.com/package/azure-iothub

qiaozha commented 1 year ago

Looks like it's in this https://github.com/Azure/azure-iot-hub-node repository.

qiaozha commented 1 year ago

@xirzec I am not sure if it's expected for service team to provide data plane JS libraries outside of the azure-sdk-for-js repo?

xirzec commented 1 year ago

@amit12cool apologies, but I don't seem to have permissions to transfer this issue directly, so can you please re-open in https://github.com/Azure/azure-iot-hub-node/issues/new ?