Note that there are some explanatory texts on larger screens.

plurals
  1. POAries Blueprint in Karaf - Can a blueprint reference an external properties file
    text
    copied!<p>I am using an ActiveMQ blueprint to setup a JMS Connection Pool. I also use Camel to service some functionality. </p> <p>I use the <code>org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer</code> to allow the use of an external properties file in setting up the <code>camel-context</code> file. </p> <p>Is there a similar type functionality using blueprints? </p> <p>So basically, I want to replace ${server.address} with a property I get from a property file in the configuration below:</p> <pre><code>&lt;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"&gt; &lt;bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"&gt; &lt;property name="brokerURL" value="nio://${server.address}" /&gt; &lt;/bean&gt; &lt;bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"&gt; &lt;property name="maxConnections" value="8" /&gt; &lt;property name="connectionFactory" ref="activemqConnectionFactory" /&gt; &lt;/bean&gt; &lt;bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration"&gt; &lt;property name="connectionFactory" ref="pooledConnectionFactory" /&gt; &lt;property name="concurrentConsumers" value="5" /&gt; &lt;/bean&gt; &lt;bean id="resourceManager" class="org.apache.activemq.pool.ActiveMQResourceManager" init-method="recoverResource"&gt; &lt;property name="transactionManager" ref="transactionManager" /&gt; &lt;property name="connectionFactory" ref="activemqConnectionFactory" /&gt; &lt;property name="resourceName" value="activemq.localhost" /&gt; &lt;/bean&gt; &lt;bean id="xaConnectionFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory"&gt; &lt;argument value="nio://${server.address}" /&gt; &lt;/bean&gt; &lt;bean id="connectionFactory" class="org.fusesource.jms.pool.JcaPooledConnectionFactory" init-method="start" destroy-method="stop"&gt; &lt;property name="connectionFactory" ref="pooledConnectionFactory" /&gt; &lt;property name="name" value="activemq" /&gt; &lt;/bean&gt; &lt;reference id="transactionManager" interface="javax.transaction.TransactionManager" /&gt; &lt;service ref="pooledConnectionFactory" interface="javax.jms.ConnectionFactory"&gt; &lt;service-properties&gt; &lt;entry key="name" value="localhost" /&gt; &lt;/service-properties&gt; &lt;/service&gt; &lt;/blueprint&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload