Apache Camel:使用油门:如何使用配置文件更改 timePeriodMillis 的值?

Apache Camel : using throttle : how to change the value of timePeriodMillis using a config file?

我在 apache camel blueprint 中使用油门:油门 timePeriodMillis="1000" 常数 = 4 我想使用 placeholder.Is 动态设置 timePeriodMillis 的值,这可能吗?

查看文档:http://camel.apache.org/using-propertyplaceholder.html

以及在XML DSL

中对任何种类的属性使用属性占位符部分

这里可以使用Properties组件

例如:

Properties properties = new Properties(); 
InputStream input = null;


public void configure() throws IOException {

   CamelContext context = new DefaultCamelContext();    

   input = new FileInputStream("sample.properties");
   properties.load(input);

   System.out.println("CITY IS" +properties.getProperty("wl.city"));
   String city = properties.getProperty("wl.city");