Apache camel 骆驼+;netty:仅在远程服务器可用时发送

Apache camel 骆驼+;netty:仅在远程服务器可用时发送,apache-camel,netty,Apache Camel,Netty,我需要通过套接字(IP和端口)将文件发送到远程传统tcp服务器。此服务器有时不可用,因此: 1-我需要检查远程tcp服务器(套接字)是否可用。 2-如果没有,我需要等待5分钟 我尝试了几种选择,但没有一种是有效的 谢谢我使用以下配置使其工作: <route> <from uri="file://inbox?move=.txt"/> <to uri="netty:tcp://localhost:5150?encoders=#encode

我需要通过套接字(IP和端口)将文件发送到远程传统tcp服务器。此服务器有时不可用,因此:

1-我需要检查远程tcp服务器(套接字)是否可用。 2-如果没有,我需要等待5分钟

我尝试了几种选择,但没有一种是有效的


谢谢

我使用以下配置使其工作:

<route>
        <from uri="file://inbox?move=.txt"/>
        <to uri="netty:tcp://localhost:5150?encoders=#encoders&amp;sync=false"/>
 </route>


看看Camel的错误处理程序,您可以在该程序中设置在两周之间延迟的重新交付,我添加了一个直接vm步骤:
        <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>