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
NIFI-4152 Initial commit of ListenTCPRecord #1987
Conversation
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.
Overall it LGTM, left few comments. Also can you rebase against master so that I can run few tests with this new processor?
public class ListenTCPRecord extends AbstractProcessor { | ||
|
||
static final PropertyDescriptor PORT = new PropertyDescriptor | ||
.Builder().name("Port") |
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.
displayName()
is missing on few properties
|
||
static final PropertyDescriptor MAX_CONNECTIONS = new PropertyDescriptor.Builder() | ||
.name("Max Number of TCP Connections") | ||
.description("The maximum number of concurrent TCP connections to accept.") |
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.
Should we add in the property description the comment you added in the capability description?
"In cases where clients are keeping a connection open, the concurrent tasks for the processor should be adjusted to match the Max Number of TCP Connections allowed, so that there is a task processing each connection."
@pvillard31 thanks for reviewing, I just rebased against master and made your suggested changes, let me know of anything else, thanks! |
Hey @bbende, just built this PR and did some tests. The template I used is here: Then I send messages using nc:
Observations:
I'm not sure if we want to raise a bulletin alert if the source is not sending any message. Thoughts?
While I understand this is the intended behaviour, I'm not sure if this is clear enough in the description of the processor. In particular, raising a bulletin and killing the connection in case no data is received could seem weird (and it's not similar to the way ListenTCP is working). Instead of killing the connection, what about just generating a flow file with the amount data available at this moment? Or change the level of the log message to info? And probably improve the message to let the user knows that the connection has been closed because no data has been received since X seconds? Thoughts? |
@pvillard31 thanks for trying it out... I made some changes so that it should only produce a bulletin when there is an error other than a read timeout, and on read timeouts I made it leave it the connection open and requeue it to try again, so it will only close the connection on other errors. Also, I found a bug in PutTCP that I introduced in another PR, so I fixed that here as well. |
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.
+1, merged to master, thanks for the changes @bbende
Forgot the magic words after rebasing... Can you close the PR @bbende? sorry about that. |
Thanks! closing... |
Adds a ListenTCPRecord processor which can read records from the InputStream of a TCP connection.