2017-06-14 105 views
0
<route> 
     <from uri="file://inbox?move=.txt"/> 
     <to uri="netty:tcp://localhost:5150?encoders=#encoders&amp;sync=false"/> 
</route> 

我需要通過套接字(IP和端口)將文件發送到遠程舊版tcp服務器。此服務器有時不可用,因此:camel + netty:只有遠程服務器可用時才發送

1-我需要檢查遠程tcp服務器(套接字)是否可用。 2-如果沒有,我需要等5分鐘。

我嘗試了幾個選項,但都沒有工作。

感謝

+0

看駱駝的錯誤處理程序,您可以與感謝 –

+0

之間的延遲設置重複傳遞,我添加了一個直接-VM步:< to uri =「direct-vm:toTcp?block = true & timeout = 10000」/> – romu31

回答

0

我做它用下面的配置工作:

 <route id="step1" trace="false"> 
     <from uri="file:/dev/tmp/datain/?sortBy=file:name;&amp;delete=true&amp;maxMessagesPerPoll=1" /> 
     <convertBodyTo type="java.lang.String" /> 
    <to uri="direct-vm:toTcp?block=true&amp;timeout=10000" /> 
    </route> 

    <route id="step2" trace="false"> 
    <from uri="direct-vm:toTcp?block=true&amp;timeout=10000" /> 
    <to uri="netty4:tcp://localhost:7000?sync=true&amp;textline=true&amp;requestTimeout=50000&amp;synchronous=true" /> 
    </route> 
相關問題