我在C中有一些旧程序,这些程序根据输入文件工作,结果转到输出文件。这两个文件都在程序参数中指定。因此,呼叫如下所示:
prj.exe a.dat a.out
基于Artem Bilan的建议,我使用以下Spring Configuration文件创建了该项目。它在调用可执行文件方面有效!但是,出站通道仍然有问题。首先,它不包含任何内容,并且出现错误“不支持的消息有效负载类型”。其次,更重要的是,我需要通过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"/>
像这样:
<int:service-activator expression="new ProcessBuilder('prj.exe', 'a.dat', 'a.out').start()"/>
?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句