且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 Apache Flink 连接到 Twitter Streaming API 时的 IOExcpetion

更新时间:2023-01-11 09:25:41

调试 com.twitter.hbc.httpclient.ClientBase 给我带来了以下异常:org.apache.http.conn.ConnectTimeoutException: 连接到 stream.twitter.com:80 超时

Debugging the com.twitter.hbc.httpclient.ClientBase brought me to the following Exception: org.apache.http.conn.ConnectTimeoutException: Connect to stream.twitter.com:80 timed out

根据 post 在 Twitter 开发者论坛上发生这种情况是因为 Apaches HttpClient 4.2 中的一个错误.事实上,解决我的项目上的依赖树表明 flink-runtime 依赖于 com.amazonaws:aws-java-sdk:1.81,而后者又依赖于 org.apache.httpcomponents:httpclient:4.2.

According to a post on the Twitter Developer forum this happens because of a bug in Apaches HttpClient 4.2. And in fact, resolving the dependency tree on my project shows that the flink-runtime has a dependency on com.amazonaws:aws-java-sdk:1.81 which again has a dependency on org.apache.httpcomponents:httpclient:4.2.

将HttpClient 4.2.6添加到我的项目的依赖中暂时解决了这个问题.

Adding HttpClient 4.2.6 to the dependencies of my project solved the problem temporarily.