【问题标题】:Apache Camel : using throttle : how to change the value of timePeriodMillis using a config file?Apache Camel:使用节流阀:如何使用配置文件更改 timePeriodMillis 的值?
【发布时间】:2017-09-05 18:44:05
【问题描述】:

我在 Apache Camel 蓝图中使用油门:油门 timePeriodMillis="1000" 常数 = 4 我想使用占位符动态放置 timePeriodMillis 的值。这可能吗?

【问题讨论】:

    标签: apache-camel activemq blueprint-osgi throttling


    【解决方案1】:

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

    以及在 XML DSL 中为任何类型的属性使用属性占位符部分

    【讨论】:

      【解决方案2】:

      这里可以使用属性组件

      例如:

      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");
      

      【讨论】:

        猜你喜欢
        • 2023-03-17
        • 2021-12-10
        • 2013-02-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-11-29
        相关资源
        最近更新 更多