【发布时间】:2016-02-12 15:30:32
【问题描述】:
我有一些 C 中的遗留程序,它们基于输入文件工作,结果转到输出文件。这两个文件都在程序参数中指定。所以调用如下所示:
prj.exe a.dat a.out
根据 Artem Bilan 的建议,我使用以下 Spring 配置文件创建了项目。它在调用可执行文件方面起作用!但是,我仍然有出站渠道的问题。首先,它不包含任何内容,并且我收到错误“不支持的消息有效负载类型”。其次,更重要的是,我需要通过Java程序处理输出文件a.out。组织此工作流程的最佳方式是什么?是否可以将这种情况下无用的 inbound-channel-adapter 替换为有用的东西?
<int-file:inbound-channel-adapter id="producer-file-adapter"
channel="inboundChannel" directory="file:/Users/anarinsky/springint/chem"
prevent-duplicates="true">
<int:poller fixed-rate="5000" />
</int-file:inbound-channel-adapter>
<int:channel id="inboundChannel" />
<int:channel id="outboundChannel" />
<int:service-activator input-channel="inboundChannel" output-channel="outboundChannel"
expression="new ProcessBuilder('/Users/anarinsky/springint/chem/prj', '/Users/anarinsky/springint/chem/a.dat', '/Users/anarinsky/springint/chem/a.out').start()">
</int:service-activator>
<int-file:outbound-channel-adapter
channel="outboundChannel" id="consumer-file-adapter"
directory="file:/Users/anarinsky/springint/chem"/>
【问题讨论】: