当前位置:web 服务器 > Apache >>

Apache Camel(1)

Camel是通过每一个endpoint作为一个线程启动,

<endpoint id="PreStart" uri="timer:PreStart?period=-1&delay=1000" />

这个定义是说名为PreStart的线程只在线程启动后立即运行一次,

<camel:route id="PreProcessing">
          <camel:from uri="PreStart"/>
          <camel:doTry>
     <camel:bean ref="ProcessPredicate" method="setPreProcessStart" />
     <camel:to uri="PreProcess" />
     <camel:bean ref="ProcessPredicate" method="setPreProcessComplete" />
     <camel:doCatch>
      <camel:exception>java.lang.Exception</camel:exception>
      <camel:handled><camel:constant>true</camel:constant></camel:handled>
      <camel:bean ref="ProcessPredicate" method="setPERSProcessError" />
     </camel:doCatch>
   </camel:doTry>
</camel:route>

路由会自动启动,开始判断PreStart是否启动,然后调用spring camel注入的bean来具体实现,这里因为采用了try-catch方式,所以exception会被抛出。

 

补充:综合编程 , 其他综合 ,
Apache
IIS
Nginx
Tomcat
如果你遇到web 服务器难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,