Can';t使用alpakka(akka流)连接到vsftpd服务器

Can';t使用alpakka(akka流)连接到vsftpd服务器,ftp,akka,alpakka,vsftpd,Ftp,Akka,Alpakka,Vsftpd,我正在尝试在Docker映像中为Alpakka FTP源连接器重新创建,但似乎无法连接。任何关于如何调整代码的指针都是非常受欢迎的: FtpSettings ftpSettings = FtpSettings .create(InetAddress.getLocalhost()) .withPort(21) .withCredentials(FtpCredentials.NonAnonFtpCredentials.create("news", "test")) .withBina

我正在尝试在Docker映像中为Alpakka FTP源连接器重新创建,但似乎无法连接。任何关于如何调整代码的指针都是非常受欢迎的:

FtpSettings ftpSettings = FtpSettings
  .create(InetAddress.getLocalhost())
  .withPort(21)
  .withCredentials(FtpCredentials.NonAnonFtpCredentials.create("news", "test"))
  .withBinary(true)
  .withPassiveMode(true)
  .withConfigureConnectionConsumer(
    (FTPClient ftpClient) -> {
      ftpClient.addProtocolCommandListener(
        new PrintCommandListener(new PrintWriter(System.out), true));
    });

Source<FtpFile, NotUsed> ftp = Ftp.ls("/", ftpSettings);
ftp.to(Sink.foreach(s -> LOGGER.info(s.name())));
FtpSettings FtpSettings=FtpSettings
.create(InetAddress.getLocalhost())
.带端口(21)
.withCredentials(FtpCredentials.nonanOptCredentials.create(“新闻”、“测试”))
.withBinary(真)
.带被动模式(真)
.使用配置连接消费者(
(FTP客户端FTP客户端)->{
ftpClient.addProtocolCommandListener(
新的PrintCommandListener(新的PrintWriter(System.out),true);
});
源ftp=ftp.ls(“/”,ftpSettings);
ftp.to(Sink.foreach->LOGGER.info(s.name());

仅供参考:登录信息正在使用,例如filezilla。

Source.to
返回一个
RunnableGraph
,这是一个您仍然需要“运行”的“蓝图”:

导入akka.actor.actor系统;
导入akka.stream.Materializer;
进口akka.stream.actormatarializer;
//创建蓝图:
RunnableGraph blueprint=ftp.to(Sink.foreach(s->LOGGER.info(s.name()));
//创建要在其中运行流的系统:
ActorSystem=ActorSystem.create();
Materializer Materializer=ActorMaterializer.create(系统);
//运行流:
blueprint.run(物化器);
您也可以使用“runWith”速记:

ftp.runWith(Sink.foreach(s -> LOGGER.info(s.name())), materializer);


是的,是个笨蛋。。。现在我只需要弄清楚为什么这会导致
500 OOPS:invalid pasv_address
,当filezilla和firefox都能够解决它时,问题就出在设置容器时使用
pasv_address=foo
。然而,我无法理解为什么菲利兹拉能够解决这个问题。