[ 
https://issues.apache.org/jira/browse/MINIFICPP-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gábor Gyimesi reassigned MINIFICPP-1849:
----------------------------------------

    Assignee: Gábor Gyimesi

> Serialization of empty response node ruins JSON
> -----------------------------------------------
>
>                 Key: MINIFICPP-1849
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-1849
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Bug
>            Reporter: Gábor Gyimesi
>            Assignee: Gábor Gyimesi
>            Priority: Minor
>
> Empty SerializedResponseNodes could ruin the outgoing JSON data. For example 
> in case there are multiple metrics defined in a metric group sent through C2 
> and one of them is empty, the serialization skips the other metrics by 
> mistake. Example configuration:
>  
> {code:java}
> nifi.c2.root.class.definitions=metrics 
> nifi.c2.root.class.definitions.metrics.name=metrics 
> nifi.c2.root.class.definitions.metrics.metrics=loadmetrics 
> nifi.c2.root.class.definitions.metrics.metrics.loadmetrics.name=LoadMetrics 
> nifi.c2.root.class.definitions.metrics.metrics.loadmetrics.classes=QueueMetrics,RepositoryMetrics{code}
> If a flow contains processors the QueueMetrics is serialized properly with 
> the connection information next to RepositoryMetrics:
> {code:java}
> "LoadMetrics": { "QueueMetrics": { "GetFile/success/LogAttribute": { 
> "datasize": "0", "datasizemax": "1048576", "queued": "0", "queuedmax": "0" } 
> }, "RepositoryMetrics": { "ff": { "full": false, "running": false, "size": 
> "0" }, "repo_name": { "full": false, "running": true, "size": "0" } }},{code}
>  But when the flow is updated with an empty configuration file, due to the 
> empty QueueMetrics, the LoadMetrics turns into an array with a single element:
>  
> {code:java}
> "LoadMetrics": [ "QueueMetrics" ]{code}
> Handling of this case in the serialization should be handled, it is probably 
> problematic in other nodes as well, not just QueueMetrics.
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to