I am using an ActiveMQ blueprint to setup a JMS Connection Pool. I also use Camel to service some functionality.
I use the org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer
to allow the use of an external properties file in setting up the camel-context
file.
Is there a similar type functionality using blueprints?
So basically, I want to replace ${server.address} with a property I get from a property file in the configuration below:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xmlns:amq="http://activemq.apache.org/schema/core">
<bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="nio://${server.address}" />
</bean>
<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="maxConnections" value="8" />
<property name="connectionFactory" ref="activemqConnectionFactory" />
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="pooledConnectionFactory" />
<property name="concurrentConsumers" value="5" />
</bean>
<bean id="resourceManager" class="org.apache.activemq.pool.ActiveMQResourceManager"
init-method="recoverResource">
<property name="transactionManager" ref="transactionManager" />
<property name="connectionFactory" ref="activemqConnectionFactory" />
<property name="resourceName" value="activemq.localhost" />
</bean>
<bean id="xaConnectionFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory">
<argument value="nio://${server.address}" />
</bean>
<bean id="connectionFactory" class="org.fusesource.jms.pool.JcaPooledConnectionFactory"
init-method="start" destroy-method="stop">
<property name="connectionFactory" ref="pooledConnectionFactory" />
<property name="name" value="activemq" />
</bean>
<reference id="transactionManager" interface="javax.transaction.TransactionManager" />
<service ref="pooledConnectionFactory" interface="javax.jms.ConnectionFactory">
<service-properties>
<entry key="name" value="localhost" />
</service-properties>
</service>
</blueprint>
<ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]" />
outside camelcontext and tried to use the karaf.home in inside camelcontext. But its failing load the data from that location. I've tried like this<propertyPlaceholder id="config" location="file:$[karaf.home]/etc/application_config.properties" />
Can't we access it inside camelcontext? – Stoss