mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
141 stars 90 forks source link

Json payload ignored when a tag is not found #484

Open neildes2 opened 1 month ago

neildes2 commented 1 month ago

For MQTT Ingress, when any one of the tags is not found in the device file, the entire payload gets dumped. shdr does not work in this fashion. You can send any tag in shdr and it will just get ignored. MQTT ingest should function like shdr and just ignore the one tag. Tested with Agent v2.3.0.16

ex. In the json payload below, if the tag "blah" is not found in the device file, none of the other tags get processed. The entire payload and all its tags gets dumped. This is not a format error, it's just that one of the tags does not exist.

{ "exec": "ACTIVE", "blah": "BLAH", "avail": "AVAILABLE" }

wsobel commented 3 weeks ago

I will take a look and verify. You are correct the error should be logged and then ignored. It is probably in the logic to stop on error.

Best Will Sobel