我正在尝试运行官方示例,该示例演示如何在Twitter上使用Apache Flink Streaming: https://github.com/apache/flink/tree/master/flink-streaming-examples/src/main/java/org/apache/flink/streaming/examples/twitter
如果我没有提供properties.file的路径,将使用TwitterStreamData.java。 “数据看起来像推文”一切都好。但是如果我想收到真正的推文(提供正确的属性文件),执行会停止并等待(不会抛出任何异常)。
在代码调试之后,我找到了执行停止并等待的地方:
ClusterUtils.runOnMiniCluster(obGraph jobGraph, int parallelism, long memorySize, boolean printDuringExecution)
程序运行到行
SerializedJobExecutionResult result = exec.submitJobAndWait(jobGraph, printDuringExecution);
并等待。
属性文件没问题,因为我在另一个例子中使用了它(没有apache flink的推文流)并且有效。
答案 0 :(得分:1)
这是Apaches HttpClient 4.2的问题。将HttpClient 4.2.6添加到项目的依赖项后,程序运行。同样的问题在这里讨论:IOExcpetion while connecting to Twitter Streaming API with Apache Flink。我找到了答案。