简体   繁体   中英

Passing Apache Camel Endpoint Uri from a Spring Property

I want to use my spring bean's property as uri of camel sql component's uri. But I have not found any information about this.

it is like:

<bean id="programBean" class="com.tcell.cms.gateway.bean.ProgramBean">
     <property name="uri" value="www.asdasa.com"/>
</bean>

And in Camel context:

<route>
    <from uril="sql:${programBean.uri}
</route>

I have looked at some samples but it did not work.

Any help will be appreciated

Thx

Ali

EDIT: I want to pass url of SQL Endpoint from an attribute of a bean. Not from a property file. The uri is an attribute of a bean.

See the Camel documentation about using property placeholders.

And also this FAQ about using spring ${ } in Camel routes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM