1

我正在尝试运行官方示例,该示例展示了如何将 Apache Flink Streaming 与 Twitter 一起使用: https ://github.com/apache/flink/tree/master/flink-streaming-examples/src/main/java/org/apache /flink/流/示例/推特

如果我不提供 properties.file 的路径,将使用 TwitterStreamData.java。有了“看起来像推文的数据”就可以了。但是,如果我想接收真正的推文(提供正确的属性文件),执行将停止并等待(不抛出异常)。

代码调试后我找到了执行停止并等待的地方:

ClusterUtils.runOnMiniCluster(obGraph jobGraph, int parallelism, long memorySize, boolean printDuringExecution)

程序运行直到行

SerializedJobExecutionResult result = exec.submitJobAndWait(jobGraph, printDuringExecution);

并等待。

属性文件没问题,因为我在另一个示例中使用了它(没有 apache flink 的推文流式传输)并且有效。

4

1 回答 1

1

这是 Apaches HttpClient 4.2 的问题。将 HttpClient 4.2.6 添加到项目的依赖项后,程序运行。同样的问题在这里讨论:IOExcpetion while connection to Twitter Streaming API with Apache Flink。我在那里找到了答案。

于 2015-12-15T15:26:08.197 回答