首页 > 解决方案 > 当 writeToSocket 什么都没有发生

问题描述

我只是关注这个https://github.com/apache/flink/blob/master/flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/socket/SocketWindowWordCount。爪哇

并添加一些部分以将结果写入套接字

    windowCounts
        .writeToSocket("localhost", 7777, new SerializationSchema<WordWithCount>() {
          @Override
          public byte[] serialize(WordWithCount wordWithCount) {
            return wordWithCount.toString().getBytes();
          }
        });

而且我的本地主机(端口 7777)上什么也没有。有什么我想念的吗?谢谢你

标签: apache-flink

解决方案


推荐阅读