骆驼批处理配置动态配置

时间:2020-03-24 17:01:17

标签: apache-camel

我将蓝图用于骆驼上下文,并使用批处理配置EIP。我希望属性是可配置的。而且似乎不起作用。有没有一种方法可以使用属性来配置批处理配置?

这项工作

<batch-config batchSize="300" batchTimeout="4000" />

我尝试了这些但是没用

<batch-config batchSize="{{MyBatchSize}}" batchTimeout="{{MyBatchTimeout}}" />
<batch-config prop:batchSize="MyBatchSize" prop:batchTimeout="MyBatchTimeout" />
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
    <!-- OSGI blueprint property placeholder -->
    <cm:property-placeholder id="myblueprint.placeholder" persistent-id="camel.blueprint">
  <camelContext xmlns="http://camel.apache.org/schema/blueprint">
    <route>
      <from uri="direct:start" />
      <resequence>
        <simple>body</simple>
        <to uri="mock:result" />
        <!--
          batch-config can be ommitted for default (batch) resequencer settings
        -->
        <batch-config batchSize="300" batchTimeout="4000" />
        <!-- <batch-config batchSize="{{MyBatchSize}}" batchTimeout="{{MyBatchTimeout}}" /> -->
        <!-- <batch-config prop:batchSize="MyBatchSize" prop:batchTimeout="MyBatchTimeout" /> -->
      </resequence>
    </route>
  </camelContext>
</blueprint>

0 个答案:

没有答案