2016-02-12 35 views
1

我有一些基於輸入文件工作的傳統程序,結果轉到輸出文件。這兩個文件都是在程序參數中指定的。因此呼叫如下所示:如何將舊版可執行文件集成到Spring Integration應用程序中?

prj.exe a.dat a.out 

基於阿爾喬姆比蘭建議,我創建了以下Spring配置文件的項目。它在調用可執行文件方面起作用!不過,我仍然遇到出站頻道的問題。首先,它不包含任何內容,而且我收到錯誤「不支持的消息負載類型」。其次,更重要的是,我需要通過Java程序處理輸出文件a.out。組織這個工作流程的最佳方式是什麼?在這種情況下,可以用無用的入站通道適配器替代有用的東西嗎?

<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"/> 

回答

1

事情是這樣的:

<int:service-activator expression="new ProcessBuilder('prj.exe', 'a.dat', 'a.out').start()"/> 

+0

工程!還有其他一些問題,請參閱說明。 –

相關問題