2016-06-28 45 views
0

參考:http://camel.apache.org/jms.html來自activeMQ的DSL進程回覆

我試圖處理活動MQ隊列的請求 - 答覆模式下的答覆。這裏是代碼的形式上面的頁面:

我試圖做到這一點:

   from("file://C:\\Users\\Thom\\git\\brms-poc-esb\\rule-cancel\\data"). 
        log("Processing ${file:name}"). 
        process(requestProcess). 
        log("Generated ${body}"). 
        to(queueUri).inOut(). 
        process(new ResultProcess()); 

當我處理這個,我仍然得到我發送給我的積極MQ流。

如何處理回覆?

回答

1

使用.to(ExchangePattern.InOut, queueUri)作爲使用inOut()之後.to()與您一樣不推薦使用。

或者你也可以做

.setExchangePattern(ExchangePattern.InOut) 
.to(queueUri) 

例如在調用到終點之前設置模式。

您可以隨時使用示蹤器查看路由期間發生的情況,以幫助您瞭解:http://camel.apache.org/tracer