dynamic change endpoint camel

后端 未结 2 1772
孤城傲影
孤城傲影 2020-12-11 09:40

Is it possible to change from endpoint in dynamic way ? for example I want change

for(endpointFirst).routeId(ROUTEID).to(finishEndpoint);

2条回答
  •  囚心锁ツ
    2020-12-11 10:08

    to change the from endpoint, you can just dynamically add/remove routes via the context APIs or alter the route as Claus suggested

    to change destination endpoints, use the recipient list EIP and an Expression to dynamically determine the endpoint based on message headers, variables, methods, etc...

    from("direct:a")
         .recipientList(header("foo"));
    

提交回复
热议问题