NIFI-8462 Refactored PutSyslog and ListenSyslog using Netty#5044
NIFI-8462 Refactored PutSyslog and ListenSyslog using Netty#5044exceptionfactory wants to merge 3 commits intoapache:mainfrom
Conversation
e9386ba to
3ac102f
Compare
...main/java/org/apache/nifi/event/transport/netty/ByteArrayMessageNettyEventServerFactory.java
Show resolved
Hide resolved
|
If someone was going to use these new classes, it might be good to have a readme or something for this part of the code |
...fi-event-transport/src/main/java/org/apache/nifi/event/transport/netty/NettyEventSender.java
Show resolved
Hide resolved
Thanks for the feedback @ottobackwards! Providing some additional documentation would be helpful, although I think it would be better to wait until other components start leveraging this module. I attempted to provide some high-level abstractions in the Please let me know if you have any additional comments or questions! |
gresockj
left a comment
There was a problem hiding this comment.
This will be a nice upgrade, @exceptionfactory! I tested it successfully with UDP and TCP with and without SSL Context Service, works as expected. Just a few comments to address.
...-event-transport/src/main/java/org/apache/nifi/event/transport/message/ByteArrayMessage.java
Outdated
Show resolved
Hide resolved
...ent-transport/src/main/java/org/apache/nifi/event/transport/netty/EventLoopGroupFactory.java
Outdated
Show resolved
Hide resolved
...le/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java
Show resolved
Hide resolved
...t-transport/src/main/java/org/apache/nifi/event/transport/netty/NettyEventSenderFactory.java
Show resolved
Hide resolved
...t-transport/src/main/java/org/apache/nifi/event/transport/netty/NettyEventSenderFactory.java
Outdated
Show resolved
Hide resolved
| "messages will be sent over a secure connection.") | ||
| .required(false) | ||
| .identifiesControllerService(SSLContextService.class) | ||
| .dependsOn(PROTOCOL, TCP_VALUE) |
There was a problem hiding this comment.
I noticed that in ListenSyslog, the SSL Context Service property is always available, but in PutSyslog it's conditional on TCP being set. Can you add the condition to both?
Also, if you have an SSL Context Service selected and then change it back to UDP, the processor is marked as invalid even though the SSL Context Service property is no longer available to be configured. Is it possible to unset this property if protocol is set to UDP, or is that just a limitation of the current "dependsOn" functionality?
There was a problem hiding this comment.
Good catch, I had intended to update both processors to make SSL Context Service depend on TCP.
I noticed the issue with SSL Context Service and changing from TCP to UDP. It seems like that is something that might make sense to address at the framework level.
...nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenSyslog.java
Outdated
Show resolved
Hide resolved
- Added nifi-event-transport module encapsulating Netty classes - Refactored unit tests for PutSyslog and ListenSyslog - Removed integration tests for PutSyslog and ListenSyslog
…dressed other issues
3ac102f to
e166cfc
Compare
|
Thanks for the thorough review and helpful feedback @gresockj! I added a commit including the changes and rebased on main to incorporate recent updates. |
|
Tested this out using the template found here: https://community.cloudera.com/t5/Community-Articles/NiFi-Send-to-syslog/ta-p/248638 and found that PutSyslog and ListenSyslog are working. Reviewed the code and it looks good. |
|
+1 will merge. |
- Added nifi-event-transport module encapsulating Netty classes - Refactored unit tests for PutSyslog and ListenSyslog - Removed integration tests for PutSyslog and ListenSyslog NIFI-8462 Added context.yield() in PutSyslog when no FlowFiles and addressed other issues NIFI-8462 Removed unused import of ExpressionLanguageScope Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes apache#5044.
- Added nifi-event-transport module encapsulating Netty classes - Refactored unit tests for PutSyslog and ListenSyslog - Removed integration tests for PutSyslog and ListenSyslog NIFI-8462 Added context.yield() in PutSyslog when no FlowFiles and addressed other issues NIFI-8462 Removed unused import of ExpressionLanguageScope Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes apache#5044.
Description of PR
NIFI-8462 Refactors the
PutSyslogandListenSyslogProcessors to use Netty for socket communication. This approach replaces the use of custom socket channel dispatcher classes innifi-processor-utils. Leveraging the NettySslHandleralso removes the use of customSSLSocketandSSLEnginehandling innifi-security-socket-sslclasses. This approach resolves latent issues with TLS 1.3 communication in these processors, described in NIFI-7468.The new
nifi-event-transportmodule abstracts communication handling for both UDP and TCP communication, providing interfaces and classes that can be leveraged in other components. Refactoring other components to leverage Netty should eventually remove the need for error-proneSSLEnginehandling in custom classes.Changes also include refactored unit tests for
PutSyslogandListenSyslog, eliminating the use of mocked senders and removing unnecessary integration tests.In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squashor use--forcewhen pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean installat the rootnififolder?LICENSEfile, including the mainLICENSEfile undernifi-assembly?NOTICEfile, including the mainNOTICEfile found undernifi-assembly?.displayNamein addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.