2015-04-02 143 views
1

任何一個可以給我一個提示,如果有可能使用阿帕奇駱駝竊聽使用

.wireTap() 

.bean(Test.class, "testMethod(Exchange)"); 

我想創建route將通過發送馬上處理請求processing…消息並且同時呼叫testMethod以便處理訂單

測試案例:

from("timer:test") 
      //.to("log:test") 
      .bean(Test.class, "testMethod2()") 
      .bean(Test.class, "testMethod(Exchange)"); 

表明testMethod正在等待testMethod2結束。我想運行這兩個方法異步

回答

2

您可以使用多播EIP在並行模式

from("timer:test") 
    .multicast().parallelProcessing(). 
      .bean(Test.class, "testMethod2()") 
      .bean(Test.class, "testMethod(Exchange)") 
    .end();