[activemq-dev] Feature - Property Resource Configurer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[activemq-dev] Feature - Property Resource Configurer

Ramzi Saba
Folks, I propose a minor change to ActiveMQBeanFactory to post-process
the bean factory using Spring's PropertyPlaceholderConfigurer, which
implicitly resolves placeholders against system properties.  We could
later provide the capability to define a list of properties files in the
Spring XML configuration.

This would avoid coupling the broker config to a specific environment, eg:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN"
"http://localhost/activemq.dtd">
<beans>
 
<!--
==================================================================== -->
  <!-- ActiveMQ Broker Configuration -->
  <!--
==================================================================== -->
  <broker name="my-broker">
    <connector>
        <tcpServerTransport uri="tcp://localhost:61616"/>
    </connector>
    <persistence>
        <jdbcPersistence dataSourceRef="activemq-ds"/>
    </persistence>
  </broker>
 
  <!--
==================================================================== -->
  <!-- JDBC DataSource Configurations -->
  <!--
==================================================================== -->
   
    <bean id="activemq-ds"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName">
            <value>${driverClassName}</value>
        </property>
        <property name="url">
            <value>${activemq-url}</value>
        </property>
        <property name="username">
            <value>${activemq-username}</value>
        </property>
        <property name="password">
            <value>${activemq-password}</value>
        </property>
    </bean>

</beans>

Unless you guys think otherwise, I am going to create a new feature
request in JIRA and implement it - it's 2 lines of code to support
system properties :)

-ramzi

Reply | Threaded
Open this post in threaded view
|

Re: [activemq-dev] Feature - Property Resource Configurer

jstrachan
Go for it! Sounds great! :)

On 11 Jul 2005, at 19:38, Ramzi Saba wrote:

> Folks, I propose a minor change to ActiveMQBeanFactory to post-
> process the bean factory using Spring's  
> PropertyPlaceholderConfigurer, which implicitly resolves  
> placeholders against system properties.  We could later provide the  
> capability to define a list of properties files in the Spring XML  
> configuration.
>
> This would avoid coupling the broker config to a specific  
> environment, eg:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//ACTIVEMQ//DTD//EN" "http://localhost/ 
> activemq.dtd">
> <beans>
> <!--  
> ==================================================================== -
> ->
>  <!-- ActiveMQ Broker Configuration -->
>  <!--  
> ==================================================================== -
> ->
>  <broker name="my-broker">
>    <connector>
>        <tcpServerTransport uri="tcp://localhost:61616"/>
>    </connector>
>    <persistence>
>        <jdbcPersistence dataSourceRef="activemq-ds"/>
>    </persistence>
>  </broker>
>  <!--  
> ==================================================================== -
> ->
>  <!-- JDBC DataSource Configurations -->
>  <!--  
> ==================================================================== -
> ->
>      <bean id="activemq-ds"  
> class="org.apache.commons.dbcp.BasicDataSource" destroy-
> method="close">
>        <property name="driverClassName">
>            <value>${driverClassName}</value>
>        </property>
>        <property name="url">
>            <value>${activemq-url}</value>
>        </property>
>        <property name="username">
>            <value>${activemq-username}</value>
>        </property>
>        <property name="password">
>            <value>${activemq-password}</value>
>        </property>
>    </bean>
>
> </beans>
>
> Unless you guys think otherwise, I am going to create a new feature  
> request in JIRA and implement it - it's 2 lines of code to support  
> system properties :)
>
> -ramzi
>
>


James
-------
http://radio.weblogs.com/0112098/