You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "turcsanyip (via GitHub)" <gi...@apache.org> on 2025/11/23 23:07:24 UTC

[PR] NIFI-15245 Updated ListenSyslog to keep the original UX with Protocol… [nifi]

turcsanyip opened a new pull request, #10556:
URL: https://github.com/apache/nifi/pull/10556

   … and Port properties
   
   # Summary
   
   [NIFI-15245](https://issues.apache.org/jira/browse/NIFI-15245)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `./mvnw clean install -P contrib-check`
     - [ ] JDK 21
     - [ ] JDK 25
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15245 Updated ListenSyslog to keep the original UX with Protocol… [nifi]

Posted by "kevdoran (via GitHub)" <gi...@apache.org>.
kevdoran commented on code in PR #10556:
URL: https://github.com/apache/nifi/pull/10556#discussion_r2554601301


##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java:
##########
@@ -101,26 +100,18 @@
 @SeeAlso({PutSyslog.class, ParseSyslog.class})
 public class ListenSyslog extends AbstractSyslogProcessor implements ListenComponent {
 
-    // See migrateProperties() below for how legacy properties are handled on upgrade
-    private static final String LEGACY_PORT_PROPERTY_NAME = "Port";
-    private static final String LEGACY_PROTOCOL_PROPERTY_NAME = "Protocol";
-
-    public static final PropertyDescriptor TCP_PORT = new PropertyDescriptor
-        .Builder().name("TCP Port")
-        .description("The port to listen on for TCP Syslog communication. Either this or UDP Port must be set, but both cannot be set at the same time.")
-        .required(false)
-        .addValidator(StandardValidators.PORT_VALIDATOR)
+    public static final PropertyDescriptor TCP_PORT = new PropertyDescriptor.Builder()
+        .fromPropertyDescriptor(PORT)
+        .name("TCP Port")
         .identifiesListenPort(org.apache.nifi.components.listen.TransportProtocol.TCP, "syslog")
-        .expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
+        .dependsOn(PROTOCOL, TCP_VALUE)
         .build();
 
-    public static final PropertyDescriptor UDP_PORT = new PropertyDescriptor
-        .Builder().name("UDP Port")
-        .description("The port to listen on for UDP Syslog communication. Either this or TCP Port must be set, but both cannot be set at the same time.")
-        .required(false)
-        .addValidator(StandardValidators.PORT_VALIDATOR)
+    public static final PropertyDescriptor UDP_PORT = new PropertyDescriptor.Builder()
+        .fromPropertyDescriptor(PORT)
+        .name("UDP Port")

Review Comment:
   Same as above:
   
   ```suggestion
           .name("UDP Port")
           .displayName("UDP Port")
   ```



##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java:
##########
@@ -101,26 +100,18 @@
 @SeeAlso({PutSyslog.class, ParseSyslog.class})
 public class ListenSyslog extends AbstractSyslogProcessor implements ListenComponent {
 
-    // See migrateProperties() below for how legacy properties are handled on upgrade
-    private static final String LEGACY_PORT_PROPERTY_NAME = "Port";
-    private static final String LEGACY_PROTOCOL_PROPERTY_NAME = "Protocol";
-
-    public static final PropertyDescriptor TCP_PORT = new PropertyDescriptor
-        .Builder().name("TCP Port")
-        .description("The port to listen on for TCP Syslog communication. Either this or UDP Port must be set, but both cannot be set at the same time.")
-        .required(false)
-        .addValidator(StandardValidators.PORT_VALIDATOR)
+    public static final PropertyDescriptor TCP_PORT = new PropertyDescriptor.Builder()
+        .fromPropertyDescriptor(PORT)
+        .name("TCP Port")

Review Comment:
   It's neat that it actually does work to have 2 properties with the same display name (`Port` in this case) interchangeable using `dependsOn`, but I think all in all it might be preferable to have the display name match the property name, to make it clearer that the property is switching when the protocol value changes, and therefore the value must also be set again... I think it could also help with troubleshooting.
   
   ```suggestion
           .name("TCP Port")
           .displayName("TCP Port")
   ```
   
   I don't feel strongly, so fee free to disregard if you feel differently. I'll approve the PR either way.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15245 Updated ListenSyslog to keep the original UX with Protocol… [nifi]

Posted by "kevdoran (via GitHub)" <gi...@apache.org>.
kevdoran merged PR #10556:
URL: https://github.com/apache/nifi/pull/10556


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15245 Updated ListenSyslog to keep the original UX with Protocol… [nifi]

Posted by "turcsanyip (via GitHub)" <gi...@apache.org>.
turcsanyip commented on PR #10556:
URL: https://github.com/apache/nifi/pull/10556#issuecomment-3570166198

   Thanks for the review @kevdoran. Updated the PR.


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org