Support Questions
Find answers, ask questions, and share your expertise

NiFiSpout Failed to receive data from NiFi: Read Timed out

NiFiSpout Failed to receive data from NiFi: Read Timed out

New Contributor

I am running a NiFi/Storm connection and I keep getting a SocketTimeoutException saying the Read timed out. I set the siteToSiteClientConfig to the localhost with the site-to-site port equal to the port set in the Nifi properties file. I am sending queued messages using a GenerateFlowFile processor. NiFi and Storm are both running and messages show up as being queued to the NiFi Output Port. What can be causing this exception?

3 REPLIES 3

Re: NiFiSpout Failed to receive data from NiFi: Read Timed out

I had an example topology that I previously used to test the storm integration:

https://github.com/bbende/nifi-storm-topology/blob/master/src/main/java/org/apache/nifi/storm/NiFiSt...

It assumes you are running everything locally and you have set the following properties in nifi.properties first:

nifi.remote.input.secure=false
nifi.remote.input.socket.port=

The port you set on the SiteToSiteClientConfig is the name of the port in the UI. In the above example it assumes you have an Output Port named "Data for Storm".

Re: NiFiSpout Failed to receive data from NiFi: Read Timed out

New Contributor

I have set secure to false and the port to 9019, then for the url in the SiteToSiteClientConfig I make sure the port is 9019, but the Read Timed Out error still persists. I noticed in your build you left the port blank, but when I do that and run my Java class I get an error saying NiFi is not configured for site-to-site. Setting the nifi.remote.input.socket.port to 9019 in the NiFi properties file fixes that "not configured for site-to-site" problem, but replaces it with a "Read Timed Out" problem.

Re: NiFiSpout Failed to receive data from NiFi: Read Timed out

On the SiteToSiteClientConfig the URL is the URL you would access the UI at, and the port is the name of the Output Port in the UI where the messages are queueing up (not the port you configured in nifi.properties).

So if you have NiFi running at http://localhost:8080/nifi and you have an output port on the graph named "Data for Storm", then it would be:

        SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder()
                    .url("http://localhost:8080/nifi")
                    .portName("Data for Storm")
                    .buildConfig();

The value of nifi.remote.input.socket.port is only used behind the scenes and you don't need to worry about it when setting up the storm topology.