tpalfy commented on code in PR #6225:
URL: https://github.com/apache/nifi/pull/6225#discussion_r940489917
##########
nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-nar/src/main/resources/META-INF/NOTICE:
##########
@@ -41,6 +41,11 @@ The following binary components are provided under the
Apache Software License v
in some artifacts (usually source distributions); but is always available
from the source code management (SCM) system project uses.
+ (ASLv2) HiveMQ MQTT Client
Review Comment:
This is good but I think we need to add it to nifi-assembly/NOTICE as well.
##########
nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/src/main/java/org/apache/nifi/processors/mqtt/common/AbstractMQTTProcessor.java:
##########
@@ -199,16 +198,13 @@ public ValidationResult validate(String subject, String
input, ValidationContext
.defaultValue(ALLOWABLE_VALUE_CLEAN_SESSION_TRUE.getValue())
.build();
- public static final PropertyDescriptor PROP_MQTT_VERSION = new
PropertyDescriptor.Builder()
- .name("MQTT Specification Version")
- .description("The MQTT specification version when connecting with
the broker. See the allowable value descriptions for more details.")
- .allowableValues(
- ALLOWABLE_VALUE_MQTT_VERSION_AUTO,
- ALLOWABLE_VALUE_MQTT_VERSION_311,
- ALLOWABLE_VALUE_MQTT_VERSION_310
- )
- .defaultValue(ALLOWABLE_VALUE_MQTT_VERSION_AUTO.getValue())
- .required(true)
+ public static final PropertyDescriptor PROP_SESSION_EXPIRY_INTERVAL = new
PropertyDescriptor.Builder()
+ .name("Session Expiry Interval")
+ .description("After this interval the broker will expire the
client and clear the session state.")
+ .addValidator(StandardValidators.NON_NEGATIVE_LONG_VALIDATOR)
+ .dependsOn(PROP_MQTT_VERSION, ALLOWABLE_VALUE_MQTT_VERSION_500)
+ .dependsOn(PROP_CLEAN_SESSION, ALLOWABLE_VALUE_CLEAN_SESSION_FALSE)
+ .defaultValue(Long.toString(SESSION_EXPIRY_INTERVAL_IN_SECONDS))
.build();
Review Comment:
I'd rather not add the quite redundant and mostly copy-pasted
`StandardValidators.NON_NEGATIVE_LONG_VALIDATOR`. We could use the more
user-friendly and readily available
`.addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)` functionality.
```suggestion
public static final PropertyDescriptor PROP_SESSION_EXPIRY_INTERVAL =
new PropertyDescriptor.Builder()
.name("Session Expiry Interval")
.description("After this interval the broker will expire the
client and clear the session state.")
.addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
.dependsOn(PROP_MQTT_VERSION, ALLOWABLE_VALUE_MQTT_VERSION_500)
.dependsOn(PROP_CLEAN_SESSION,
ALLOWABLE_VALUE_CLEAN_SESSION_FALSE)
.defaultValue(SESSION_EXPIRY_INTERVAL_IN_SECONDS + " sec")
.build();
```
--
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]