Skip to content

Commit e216a53

Browse files
committed
Review update
1 parent 2b4dee2 commit e216a53

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

CONTROLLERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ In the list below, the names of required properties appear in bold. Any other pr
282282

283283
### Description
284284

285-
Reads Sparkplug B messages and turns them into individual Record objects. The reader expects a single Sparkplug B payload in a read operation, which is a protobuf-encoded binary message. This reader is typically used with MQTT processors like ConsumeMQTT.
285+
Reads Sparkplug B messages and turns them into individual Record objects. The reader expects a single Sparkplug B payload in a read operation, which is a protobuf-encoded binary message. This reader is designed to be used with ConsumeMQTT, since Sparkplug B is an MQTT-based protocol.
286286

287287
### Properties
288288

PROCESSORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ In the list below, the names of required properties appear in bold. Any other pr
390390

391391
### Description
392392

393-
This Processor gets the contents of a FlowFile from a MQTT broker for a specified topic. The the payload of the MQTT message becomes content of a FlowFile
393+
This Processor gets the contents of a FlowFile from a MQTT broker for a specified topic. The the payload of the MQTT message becomes content of a FlowFile. If Record Reader and Record Writer are set, then the MQTT message specific attributes are not set in the flow file, because different attributes can be set for different records. In this case if Add Attributes As Fields is set to true, the attributes will be added to each record as fields.
394394

395395
### Properties
396396

docker/test/integration/features/steps/steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@ def step_impl(context):
438438

439439
@given("a SparkplugBReader controller service is set up")
440440
def step_impl(context):
441-
json_record_set_reader = SparkplugBReader("SparkplugBReader")
441+
sparkplug_record_set_reader = SparkplugBReader("SparkplugBReader")
442442
container = context.test.acquire_container(context=context, name="minifi-cpp-flow")
443-
container.add_controller(json_record_set_reader)
443+
container.add_controller(sparkplug_record_set_reader)
444444

445445

446446
@when("a test Sparkplug payload is published to the topic \"{topic}\"")

extensions/mqtt/controllers/SparkplugBReader.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class SparkplugBReader final : public core::RecordSetReaderImpl {
3333
~SparkplugBReader() override = default;
3434

3535
EXTENSIONAPI static constexpr const char* Description = "Reads Sparkplug B messages and turns them into individual Record objects. "
36-
"The reader expects a single Sparkplug B payload in a read operation, which is a protobuf-encoded binary message. This reader is typically used with MQTT processors like ConsumeMQTT.";
36+
"The reader expects a single Sparkplug B payload in a read operation, which is a protobuf-encoded binary message. This reader is designed to be used with ConsumeMQTT, "
37+
"since Sparkplug B is an MQTT-based protocol.";
3738

3839
EXTENSIONAPI static constexpr auto Properties = std::array<core::PropertyReference, 0>{};
3940

extensions/mqtt/processors/ConsumeMQTT.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class ConsumeMQTT : public processors::AbstractMQTTProcessor {
4747
}
4848

4949
EXTENSIONAPI static constexpr const char* Description = "This Processor gets the contents of a FlowFile from a MQTT broker for a specified topic. "
50-
"The the payload of the MQTT message becomes content of a FlowFile";
50+
"The the payload of the MQTT message becomes content of a FlowFile. If Record Reader and Record Writer are set, then the MQTT message specific attributes are not set in the flow file, "
51+
"because different attributes can be set for different records. In this case if Add Attributes As Fields is set to true, the attributes will be added to each record as fields.";
5152

5253
EXTENSIONAPI static constexpr auto Topic = core::PropertyDefinitionBuilder<>::createProperty("Topic")
5354
.withDescription("The topic to subscribe to.")
@@ -125,8 +126,8 @@ class ConsumeMQTT : public processors::AbstractMQTTProcessor {
125126
EXTENSIONAPI static constexpr auto IsRetainedOutputAttribute = core::OutputAttributeDefinition<0>{"mqtt.isRetained", {},
126127
"Whether or not this message was from a current publisher, or was \"retained\" by the server as the last message published on the topic."};
127128
EXTENSIONAPI static constexpr auto RecordCountOutputAttribute = core::OutputAttributeDefinition<0>{"record.count", {}, "The number of records received"};
128-
EXTENSIONAPI static constexpr auto OutputAttributes = std::array<core::OutputAttributeReference, 7>{BrokerOutputAttribute, TopicOutputAttribute, TopicSegmentOutputAttribute,
129-
QosOutputAttribute, IsDuplicateOutputAttribute, IsRetainedOutputAttribute, RecordCountOutputAttribute};
129+
EXTENSIONAPI static constexpr auto OutputAttributes = std::to_array<core::OutputAttributeReference>({BrokerOutputAttribute, TopicOutputAttribute, TopicSegmentOutputAttribute,
130+
QosOutputAttribute, IsDuplicateOutputAttribute, IsRetainedOutputAttribute, RecordCountOutputAttribute});
130131

131132
EXTENSIONAPI static constexpr bool SupportsDynamicProperties = false;
132133
EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;

0 commit comments

Comments
 (0)