Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message routing not working for null value in properties #1226

Open
amit12cool opened this issue Nov 26, 2024 · 0 comments
Open

Message routing not working for null value in properties #1226

amit12cool opened this issue Nov 26, 2024 · 0 comments
Labels

Comments

@amit12cool
Copy link

amit12cool commented Nov 26, 2024

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.

@amit12cool amit12cool added the bug label Nov 26, 2024
@amit12cool amit12cool changed the title Message routing not working Message routing not working for null value in properties Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant