1
駱駝路由器我有下面的路由。駱駝:路由前修改輸出
from("jetty:http://localhost:9092?matchOnUriPrefix=true").
to("http://server:9093/service1?bridgeEndpoint=true&throwExceptionOnFailure=false")
.to("http://server:9094/service2?bridgeEndpoint=true&throwExceptionOnFailure=false")
.to("log:output")
上述路由工作正常。
但我的要求是在發送到service2之前修改service1的輸出。就像如果我得到 <x>abc</x>
我必須把它轉換成
<y><x>abc</x></y>
我使用處理器試過,但我得到的exchange.getOut()用於服務2爲空,而實際上它返回的XML。
有人可以幫助我,如果這是可能的?如果問題不明確,請告知我。
你可以顯示你的處理器代碼。 – techuser
Hi @ user-soma, 以下是我的處理器代碼。 '.process(新處理器(){ \t \t \t \t \t \t @Override \t \t \t公共無效處理(交易交換)拋出異常{ \t \t \t \t消息中= exchange.getOut(); \t \t \t \t \t \t \t \t exchange.getOut()。setBody(共nvertIncomingRequestToOutgoingRequest(in.getBody(IncomingRequest.class))); \t \t \t}' –