activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Shabino (JIRA)" <j...@apache.org>
Subject [jira] Created: (AMQ-1716) Hard to set SystemUsage params via Spring
Date Fri, 09 May 2008 22:06:43 GMT
Hard to set SystemUsage params via Spring
-----------------------------------------

                 Key: AMQ-1716
                 URL: https://issues.apache.org/activemq/browse/AMQ-1716
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.1.0
            Reporter: Steve Shabino
            Priority: Minor


I expected to be able to configure system usage parameters via Spring like this:

{code:title=Expected Spring SystemUsage Bean Definition}

<bean id="systemUsage"
	class="org.apache.activemq.usage.SystemUsage">
	<property name="memoryUsage">
		<bean class="org.apache.activemq.usage.MemoryUsage">
			<property name="limit" value="100000000" />
		</bean>
	</property>
	<property name="storeUsage">
		<bean class="org.apache.activemq.usage.StoreUsage">
			<property name="limit" value="50000000" />
		</bean>
	</property>
	<property name="tempUsage">
		<bean class="org.apache.activemq.usage.TempUsage">
			<property name="limit" value="100000000" />
		</bean>
	</property>
</bean>

<bean id="myBroker"
		class="org.apache.activemq.broker.BrokerService" init-method="start"
		destroy-method="stop">
		<property name="systemUsage" ref="systemUsage" />
		<stuff missing here/>
</bean>
{code}

However, this does not work because the StorageUsage and TempUsage are never bound to the
persistenceAdapter or tempDataStore.

This is the workaround I had to use:

{code:title=Required Spring SystemUsage Bean Definition}

	<bean id="persistenceAdapter"
		class="org.apache.activemq.store.amq.AMQPersistenceAdapter">
		<property name="syncOnWrite" value="false" />
		<property name="directory" value="file:c:\mqdata" />
	</bean>

	<bean id="tempDataStore"
		class="org.apache.activemq.kaha.StoreFactory" factory-method="open">
		<constructor-arg type="java.io.File">
			<value>file:c:\mqtemp</value>
		</constructor-arg>
		<constructor-arg type="java.lang.String">
			<value>rw</value>
		</constructor-arg>
	</bean>
	
	<bean id="systemUsage"
		class="org.apache.activemq.usage.SystemUsage">
	<constructor-arg type="java.lang.String"
			value="localABSystemUsage" />
	<constructor-arg
			type="org.apache.activemq.store.PersistenceAdapter"
			ref="persistenceAdapter" />
	<constructor-arg type="org.apache.activemq.kaha.Store"
			ref="tempDataStore" />
	<property name="memoryUsage">
		<bean class="org.apache.activemq.usage.MemoryUsage">
			<property name="limit" value="100000000" />
		</bean>
	</property>
	<property name="storeUsage">
		<bean class="org.apache.activemq.usage.StoreUsage">
			<property name="limit" value="50000000" />
		</bean>
	</property>
	<property name="tempUsage">
		<bean class="org.apache.activemq.usage.TempUsage">
			<property name="limit" value="100000000" />
		</bean>
	</property>
</bean>

<bean id="myBroker"
		class="org.apache.activemq.broker.BrokerService" init-method="start"
		destroy-method="stop">

		<property name="systemUsage" ref="systemUsage" />
		<property name="persistenceAdapter" ref="persistenceAdapter" />
		<property name="tempDataStore" ref="tempDataStore" />

		<stuff missing here/>
		
	</bean>

{code}

One problem with this work-around is that old temp files are never purged as they would be
if I simply configured the temp directory via the BrokerService interface.  It would be nice
to have a more straight-forward means of configuring the BrokerService via Spring.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message