-
Notifications
You must be signed in to change notification settings - Fork 2.9k
NIFI-15441 ListenUDP - include sending port in 'sender' attr; correct attr doc #10743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing this adjustment @greyp9.
Although changing udp.sender to include the port number preserves the host, the addition of the port may have an impact on flow designs that expect udp.sender to contain only the host address.
Given the long-standing nature of this FlowFile attribute value, it seems better to introduce the sending port in a different attribute, with udp.sender.port as a good potential option. That would provide the additional information, without changing the current definition of udp.sender.
Thanks, sounds good. |
| this(sender, null, data, responder); | ||
| } | ||
|
|
||
| public StandardEvent(final String sender, final String senderPort, final byte[] data, final ChannelResponder<C> responder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a second ctor here so as not to impact ListenUDPRecord. Not sure if we want to propagate the PR there as well.
| @Override | ||
| public StandardEvent create(final byte[] data, final Map<String, String> metadata, final ChannelResponder responder) { | ||
| String sender = null; | ||
| String senderPort = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StandardEventFactory looks like it is used to populate FF attributes, so I chose to use a String to hold the port data (if known).
| mockEvents.add(new StandardEvent<>(sender1, message, responder)); | ||
| mockEvents.add(new StandardEvent<>(sender2, message, responder)); | ||
| mockEvents.add(new StandardEvent<>(sender2, message, responder)); | ||
| mockEvents.add(new StandardEvent<>(sender1, senderPort1, message, responder)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I'm looking at this again, we may want to use the three arg ctor here?
Summary
NIFI-15441
ListenUDPdocumentation to reflect output FlowFile attributeudp.portas being the listening port (do not change behavior).ListenUDPoutput FlowFile attributeudp.senderto include remote port, via use ofInetSocketAddress.toString(). Example: from/127.0.0.1to/127.0.0.1:54545Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation