Skip to content

Message routing not working for null value in properties #1226

@amit12cool

Description

@amit12cool

I have a message route query on iotHub like below:-
IS_OBJECT($twin.properties.reported.deviceOperations) OR $twin.properties.reported.deviceOperations = null

Expected result:-

Message should be delivered to the endpoint having twin like below:-

	"properties": {
		"reported": {
			"deviceOperations": {
				"6a8e9bb0-631b-42ad-a3ec-7c8fe4a67c6c": {
					"requestType": "fileDownload",
					"metadata": {
						"key": "value"
					},
					"blobName": "<Some_BLob_Name>",
					"progressUpdate": false,
					"de88a4ed-6eb0-483b-a929-cf0ae544e0df": {
						"wipe": true
					}
				}
			},
     }

This is getting delivered and is working fine due to the IS_OBJECT query in message routing

The problem/issue arises in the second query for json below

"properties": {
		"reported": {
			"deviceOperations":  null
     }
}

this is not getting delivered to the endpoint but it should due to this condition $twin.properties.reported.deviceOperations = null.

And the reported property deviceOperations is getting cleared in twin but somehow not delivered to the endpoint.
Also when i put the message routing query as true I get the message in my endpoint as below
[EventHubMonitor] [9:21:31 AM] Message received:

{
  "version": 6,
  "properties": {
    "reported": {
      "deviceOperations": null,
      "$metadata": {
        "$lastUpdated": "2024-11-26T03:51:31.5199729Z",
        "deviceOperations": null
      },
      "$version": 3
    }
  }
}

So only the condition $twin.properties.reported.deviceOperations = null in message routing doesn't work

Am I missing anything?

Note:- The test works in the Azure UI portal for above JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions