You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serializes recordset to Sparkplug B messages and writes them into a FlowFile. This writer is typically used with MQTT processors like PublishMQTT.
303
+
304
+
### Properties
305
+
306
+
In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
307
+
308
+
| Name | Default Value | Allowable Values | Description |
Copy file name to clipboardExpand all lines: docker/test/integration/features/mqtt.feature
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -579,3 +579,39 @@ Feature: Sending data to MQTT streaming platform using PublishMQTT
579
579
And a flowfile with the JSON content '[{"_isDuplicate": false, "_qos": 0, "_topicSegments": ["spBv1.0", "TestGroup", "DDATA", "TestNode", "TestDevice"], "_topic": "spBv1.0/TestGroup/DDATA/TestNode/TestDevice", "_isRetained": false, "body": "test-body", "uuid": "test-uuid", "seq": 12345, "metrics": [{"int_value": 123, "timestamp": 45345346346, "name": "TestMetric"}], "timestamp": 987654321}]' is placed in the monitored directory in less than 60 seconds
580
580
And the Minifi logs contain the following message: "key:record.count value:1" in less than 60 seconds
581
581
And the Minifi logs contain the following message: "key:mqtt.broker value:mqtt-broker-" in less than 1 seconds
582
+
583
+
Scenario: A MiNiFi instance publishes then consumes Sparkplug message through MQTT broker
584
+
Given an MQTT broker is set up in correspondence with the PublishMQTT and ConsumeMQTT
585
+
586
+
And a SparkplugBReader controller service is set up in the "consumer-client" flow
587
+
And a JsonRecordSetWriter controller service is set up with "Array" output grouping in the "consumer-client" flow
588
+
And a SparkplugBWriter controller service is set up in the "publisher-client" flow
589
+
And a JsonTreeReader controller service is set up in the "publisher-client" flow
590
+
591
+
And a file with the content '{"timestamp":987654321,"metrics":[{"int_value":123,"timestamp":45345346346,"name":"TestMetric"}],"seq":12345,"body":"test-body","uuid":"test-uuid"}' is present in '/tmp/input'
592
+
593
+
And a GetFile processor with the "Input Directory" property set to "/tmp/input" in the "publisher-client" flow
594
+
And a PublishMQTT processor in the "publisher-client" flow
595
+
And the "Topic" property of the PublishMQTT processor is set to "spBv1.0/TestGroup/DDATA/TestNode/TestDevice"
596
+
And the "MQTT Version" property of the PublishMQTT processor is set to "3.1.1"
597
+
And the "Record Reader" property of the PublishMQTT processor is set to "JsonTreeReader"
598
+
And the "Record Writer" property of the PublishMQTT processor is set to "SparkplugBWriter"
599
+
600
+
And the "success" relationship of the GetFile processor is connected to the PublishMQTT
601
+
602
+
And a ConsumeMQTT processor in the "consumer-client" flow
603
+
And the "Topic" property of the ConsumeMQTT processor is set to "spBv1.0/TestGroup/DDATA/TestNode/TestDevice"
604
+
And the "MQTT Version" property of the ConsumeMQTT processor is set to "3.1.1"
605
+
And the "Record Reader" property of the ConsumeMQTT processor is set to "SparkplugBReader"
606
+
And the "Record Writer" property of the ConsumeMQTT processor is set to "JsonRecordSetWriter"
607
+
And a PutFile processor with the "Directory" property set to "/tmp/output" in the "consumer-client" flow
608
+
And a LogAttribute processor with the "Log Payload" property set to "true" in the "consumer-client" flow
609
+
And the "success" relationship of the ConsumeMQTT processor is connected to the PutFile
610
+
And the "success" relationship of the PutFile processor is connected to the LogAttribute
611
+
612
+
When all instances start up
613
+
614
+
Then the MQTT broker has a log line matching "Received SUBSCRIBE from consumer-client"
615
+
And a flowfile with the JSON content '[{"_isDuplicate": false, "_qos": 0, "_topicSegments": ["spBv1.0", "TestGroup", "DDATA", "TestNode", "TestDevice"], "_topic": "spBv1.0/TestGroup/DDATA/TestNode/TestDevice", "_isRetained": false, "body": "test-body", "uuid": "test-uuid", "seq": 12345, "metrics": [{"int_value": 123, "timestamp": 45345346346, "name": "TestMetric"}], "timestamp": 987654321}]' is placed in the monitored directory in less than 60 seconds
616
+
And the Minifi logs contain the following message: "key:record.count value:1" in less than 60 seconds
617
+
And the Minifi logs contain the following message: "key:mqtt.broker value:mqtt-broker-" in less than 1 seconds
0 commit comments