exceptionfactory commented on a change in pull request #5136:
URL: https://github.com/apache/nifi/pull/5136#discussion_r647887457



##########
File path: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/eventhub/ConsumeAzureEventHub.java
##########
@@ -332,6 +345,26 @@ public void setWriterFactory(RecordSetWriterFactory 
writerFactory) {
                     .valid(false)
                     .build());
         }
+
+        if (storageAccountKey == null && storageSasToken == null) {
+            results.add(new ValidationResult.Builder()
+                    .subject(String.format("%s or %s",
+                            STORAGE_ACCOUNT_KEY.getDisplayName(), 
STORAGE_SAS_TOKEN.getDisplayName()))
+                    .explanation(String.format("either %s or %s should be 
set.",
+                            STORAGE_ACCOUNT_KEY.getDisplayName(), 
STORAGE_SAS_TOKEN.getDisplayName()))
+                    .valid(false)
+                    .build());
+        }
+
+        if (storageAccountKey != null && storageSasToken != null) {

Review comment:
       Should this use StringUtils.isNotBlank() to confirm that the properties 
are both not null and not blank?

##########
File path: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/eventhub/ConsumeAzureEventHub.java
##########
@@ -228,7 +229,16 @@
             .sensitive(true)
             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
             
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
-            .required(true)
+            .required(false)
+            .build();
+    static final PropertyDescriptor STORAGE_SAS_TOKEN = new 
PropertyDescriptor.Builder()
+            .name("storage-sas-token")
+            .displayName("Storage SAS Token")
+            .description("The Azure Storage SAS token to store event hub 
consumer group state. Always starts with a ? character.")

Review comment:
       If the value should always start with a `?` character, does it make 
sense to use a Regular Expression pattern matching validator for this property?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to