Как изменить значение свойства внутри Apache Camel Route?

На ubuntustudio 14.04 (тот же для всех debian distros):

sudo apt-get install libproj-dev libgdal-dev

Тогда я мог установить пакет rgdal

R info:
R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"

Linux info:
Linux francois-K53SV 3.13.0-34-lowlatency #60-Ubuntu SMP PREEMPT Wed Aug 13 16:15:18 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
1
задан E.Ambrosi 18 January 2019 в 07:58
поделиться

1 ответ

Свойства, оцениваемые с помощью синтаксиса {{property}}, разрешаются только один раз во время инициализации контекста. Если вам нужно отразить изменения во время выполнения, используйте Простой язык

Пример:

<bean id="myProperties" class="java.util.Properties"/>

<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
    <property name="cache" value="false"/>
    <property name="location" value="classpath:res.properties"/>
    <property name="overrideProperties" ref="myProperties" />
</bean>


<camelContext id="ctx" xmlns="http://camel.apache.org/schema/spring">
    <route id="toParamRoute">
        <from uri="timer://foo"/>
        <log message="About to change property test from value ${properties:test} to value ${exchangeProperty.CamelTimerCounter}. Initial value was {{test}}"/>
        <bean ref="myProperties" method="setProperty(test, ${exchangeProperty.CamelTimerCounter})" />
        <log message="New value is ${properties:test}"/>
    </route>
</camelContext>
0
ответ дан Bedla 18 January 2019 в 07:58
поделиться
Другие вопросы по тегам:

Похожие вопросы: