dynamic change endpoint camel

删除回忆录丶 提交于 2019-11-28 12:44:31

You would need to

  1. stop the route
  2. remove the route
  3. change the endpoint
  4. add the route
  5. start the route

This allows you to change the from endpoint to whatever you want (for example something else)

Some components / endpoint do allow to change options an have those being updated at runtime. For example the JMS endpoint allows this, so you can

  1. stop the route
  2. change an option on the jms endpoint
  3. start the route

But there may be some components which cannot do that.

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"));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!