Support Questions

Find answers, ask questions, and share your expertise

NiFi ListenTCP processor error when multiple dataflows use the same port

avatar
Expert Contributor

Hi All,

I have a NiFi dataflow on a standalone NiFi instance, with a custom processor that is a modified version of the ListenTCP processor; the NiFi instance is ingesting data from an external system, which pushes the data to NiFi instance. I made a copy of the dataflow, and by mistake I had both dataflows running (the original and the copy), which resulted in an error, possibly because both dataflows were trying to read data on the same port on the ListenTCP processor. Is this the expected behavior (failing) or it should have worked load balancing the incoming data between the 2 dataflows ? I understand the proper way to load balance is to ingest the data only once on the primary node and using a RPG distribute the data across the nodes in the cluster.

Second question I have is, I stopped the original dataflow and started to run the copy, but now the data ingestion is not working, with an unusual error shown in the log - java.lang.NumberFormatException: For input string:"2147486900"; the string the error is pointing to does not exist in the incoming data from the external system; and the number in the error message seems to increment with each occurrence of the error in the log, like "2147486900", "2147487000", "2147487100",....

Any thoughts on what could be causing this error:

Thanks in advance.

1 ACCEPTED SOLUTION

avatar
Master Guru

The first error is expected behavior, only one process can bind to an operating system port as a listener, so the first ListenTCP that you start with that port is the only one that can bind to it. This would be similar to starting two NiFi instances on the same machine and leaving their web ports both set as 8080, one will come up and one will fail.

The second part is hard to tell with out more info. Need to see which processor, if custom it would help to see the code, and also need to see the stacktrace from the logs.

View solution in original post

2 REPLIES 2

avatar
Master Guru

The first error is expected behavior, only one process can bind to an operating system port as a listener, so the first ListenTCP that you start with that port is the only one that can bind to it. This would be similar to starting two NiFi instances on the same machine and leaving their web ports both set as 8080, one will come up and one will fail.

The second part is hard to tell with out more info. Need to see which processor, if custom it would help to see the code, and also need to see the stacktrace from the logs.

avatar
Expert Contributor

thanks @Bryan Bende, our Java Developer is looking into the custom code