turcsanyip commented on code in PR #6417:
URL: https://github.com/apache/nifi/pull/6417#discussion_r970855095
##########
nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/src/main/java/org/apache/nifi/processors/mqtt/PublishMQTT.java:
##########
@@ -117,23 +118,32 @@ public class PublishMQTT extends AbstractMQTTProcessor
implements MqttCallback {
.description("FlowFiles that failed to send to the destination are
transferred to this relationship.")
.build();
- private static final List<PropertyDescriptor> descriptors;
- private static final Set<Relationship> relationships;
-
- static {
- final List<PropertyDescriptor> innerDescriptorsList =
getAbstractPropertyDescriptors();
- innerDescriptorsList.add(PROP_TOPIC);
- innerDescriptorsList.add(PROP_QOS);
- innerDescriptorsList.add(PROP_RETAIN);
- innerDescriptorsList.add(RECORD_READER);
- innerDescriptorsList.add(RECORD_WRITER);
- descriptors = Collections.unmodifiableList(innerDescriptorsList);
-
- final Set<Relationship> innerRelationshipsSet = new HashSet<>();
- innerRelationshipsSet.add(REL_SUCCESS);
- innerRelationshipsSet.add(REL_FAILURE);
- relationships = Collections.unmodifiableSet(innerRelationshipsSet);
- }
+ private static final List<PropertyDescriptor> PROPERTIES =
Collections.unmodifiableList(Arrays.asList(
+ PROP_BROKER_URI,
+ PROP_MQTT_VERSION,
+ PROP_USERNAME,
+ PROP_PASSWORD,
+ PROP_SSL_CONTEXT_SERVICE,
+ PROP_CLEAN_SESSION,
+ PROP_SESSION_EXPIRY_INTERVAL,
+ PROP_CLIENTID,
+ PROP_TOPIC,
+ PROP_RETAIN,
+ PROP_QOS,
+ RECORD_READER,
Review Comment:
There are 2 main principles when ordering properties:
* properties with higher importance / being used frequently should come first
* keep related properties together
I believe the Timeout and Last Will properties are the least frequently used
ones. Also, the by default visible Record properties may encourage their use.
For these reasons I would keep this order even if those properties rather
belong to the MQTT config. Record Writer has a similar position in the List*
processors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]