【发布时间】:2017-09-05 18:44:05
【问题描述】:
我在 Apache Camel 蓝图中使用油门:油门 timePeriodMillis="1000" 常数 = 4 我想使用占位符动态放置 timePeriodMillis 的值。这可能吗?
【问题讨论】:
标签: apache-camel activemq blueprint-osgi throttling
我在 Apache Camel 蓝图中使用油门:油门 timePeriodMillis="1000" 常数 = 4 我想使用占位符动态放置 timePeriodMillis 的值。这可能吗?
【问题讨论】:
标签: apache-camel activemq blueprint-osgi throttling
查看文档:http://camel.apache.org/using-propertyplaceholder.html
以及在 XML DSL 中为任何类型的属性使用属性占位符部分
【讨论】:
这里可以使用属性组件
例如:
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");
【讨论】: