Java SFTP入站通道适配器在PollableChannel接收方法处挂起

Java SFTP入站通道适配器在PollableChannel接收方法处挂起,java,spring,sftp,spring-integration,Java,Spring,Sftp,Spring Integration,我的上下文xml如下所示: <bean id="defaultSftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"> <property name="host" value="${host}"/> <property name="password" value="${p

我的上下文xml如下所示:

<bean id="defaultSftpSessionFactory"
            class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
        <property name="host" value="${host}"/>
        <property name="password" value="${password}"/>
        <property name="port" value="${port}"/>
        <property name="user" value="${username}"/>
    </bean>

        <int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
            session-factory="sftpSessionFactory"
            channel="receiveChannel"
            filename-pattern="*.txt"
            remote-directory="/loblawln"
            local-directory="/local-dir"
            auto-create-local-directory="true"
            temporary-file-suffix=".writing"
            delete-remote-files="false">
        <int:poller fixed-rate="1000" max-messages-per-poll="1"/>
</int-sftp:inbound-channel-adapter>

    <int:channel id="receiveChannel">
        <int:queue/>
    </int:channel>

java文件如下所示:

PollableChannel localFileChannel = context.getBean("receiveChannel", PollableChannel.class);

        SourcePollingChannelAdapter adapter = context.getBean(SourcePollingChannelAdapter.class);
        adapter.start();
        System.out.println("Adapter started...");

        Message<?> received = localFileChannel.receive();
        System.out.println("Received first file message: " + received);
PollableChannel localFileChannel=context.getBean(“receiveChannel”,PollableChannel.class);
SourcePollingChannelAdapter=context.getBean(SourcePollingChannelAdapter.class);
adapter.start();
System.out.println(“适配器已启动…”);
Message received=localFileChannel.receive();
System.out.println(“收到的第一个文件消息:“+收到”);
我已经提到了Gary Russell在Github提供的实现,并且也关注了sftp集成的spring文档。我想我错过了一些重要的事情。
此外,日志也没有显示任何内容。

通过将密钥更改为“读取用户名”,问题得到了解决。 当我调试代码并读取defaultSessionFactory实例中的值时,我觉得这有点奇怪,我发现它不是从属性文件中读取用户名,而是读取与System.getProperty(“user.name”)对应的值。当我将密钥从{username}更改为其他类似{sftp.username}的内容时,它正确地读取了它