- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 Spring Integration 的新手,我正在使用两个流程:
1.- 从sftp读取文件,保存信息。我使用方法“mget”。
2.- 保存信息后,使用“mput”方法重命名在 sftp 服务器中处理的文件。
这是我的配置:
<bean id="filePrinter" class="com.maven.integration.FilePrinter" />
<int:channel id="outboundChannel"></int:channel>
<int:channel id="aggregateResultsChannel"/>
<int:channel id="toGet"></int:channel>
<int:gateway id="simpleGateway" service-interface="com.maven.integration.FileGateway"
default-request-channel="ftpChannel" />
<int-sftp:outbound-gateway
session-factory="sftpClientFactory"
request-channel="ftpChannel"
command="mget"
command-options="-R -P"
expression="payload"
filename-regex="(new|.*.csv)"
mode="IGNORE"
local-directory-expression="@targetDir.get() + #remoteDirectory"
reply-channel="outboundChannel"
>
<int-sftp:request-handler-advice-chain>
<int:retry-advice />
</int-sftp:request-handler-advice-chain>
</int-sftp:outbound-gateway>
<int:splitter input-channel="outboundChannel" output-channel="toGet"/>
<bean id="targetDir" class="java.util.concurrent.atomic.AtomicReference">
<constructor-arg value="${target}"/>
</bean>
<int:service-activator ref="filePrinter" method="print"
input-channel="toGet"/>
<int-sftp:outbound-gateway
session-factory="sftpClientFactory"
request-channel="toGet"
command="mput"
command-options="-R"
local-directory="src/test/"
expression="payload"
filename-regex="(new|.*.csv)"
mode="IGNORE"
remote-filename-generator-expression="payload.getName() + '.ack'"
remote-directory-expression="#remoteDirectory"
reply-channel="aggregateResultsChannel"
>
<int-sftp:request-handler-advice-chain>
<int:retry-advice />
</int-sftp:request-handler-advice-chain>
</int-sftp:outbound-gateway>
<int:aggregator input-channel="aggregateResultsChannel"/>
目前只执行了第一个带有mget命令的outbound-gateway,但第二个outbound-gateway没有执行,第二个进程怎么可能运行?
最佳答案
因为你的toGet
很简单DirectChannel
具有“每个消息订阅者只有一个”逻辑。同时您的mput
网关使用它作为其 request-channel="toGet"
与
共享此 channel 。从此
<int:service-activator>is earlier in the config, it is a first subscriber in the
获取and therefore only this one process the message sent to the
toGet` 通过分割器。
我认为你需要做的事情(如果故事仍然是关于 mput
)与你在 mget
中所做的完全相反。 。因此,您应该在拆分的同时执行该逻辑,而不是在拆分之后执行。因此您应该发送MGET
结果到分离器和 MPUT
在平行下。为此,我建议您更改您的 outboundChannel
到<publish-subscribe-channel>
并使用这个 outboundChannel
在 mput
其网关 request-channel
.
关于java - 如何使用多个sftp出站网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48387687/
前不久,哔哩哔哩(一般常称为 B 站)发布了一篇文章《2021.07.13 我们是这样崩的》,详细回顾了他们在 2021.07.13 晚上全站崩溃约 3 小时的至暗时刻,以及万分紧张的故障定位与恢复过
想象一下这种情况,周围有一些智能手机和计算机,它们的 WiFi 适配器(无线适配器)打开,但没有必要连接到网络。 有没有办法通过 Linux 机器查看 MAC 地址? 任何见解表示赞赏。 最佳答案 断
我无法创建新的 Window Station 来运行我的应用程序 int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { wprintf(L"
在 Conda 环境中安装包后,我想对该包中的代码进行一些更改。 在哪里可以找到包含已安装包的 site-packages 目录? 我有 Anaconda Python 2.7 base 发行版,但找
今天去改了matplotlib的配置。搜索 matplotlibrc 发现我有两个: 查看site-packages 文件夹,我发现很多包的名称中都有波浪号: ~klearn 是 sklearn ,但
我是一名优秀的程序员,十分优秀!