activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jai_M <mjaiganesh...@yahoo.com>
Subject Spring injection and ActiveMQConnectionFactory
Date Thu, 07 May 2009 17:29:57 GMT

Hi,

  I am on 5.2 and I am using sring injection to initialize my broker and
JMSTemplate using dependency injection. My application seems to hang with
the the following log messages

10:10:20.158 [main] INFO  o.a.a.t.TransportServerThreadSupport - Listening
for connections at: tcp://hostname:61616
10:10:20.158 [main] INFO  o.a.a.broker.TransportConnector - Connector tcp
Started
10:10:20.158 [main] INFO  o.a.activemq.broker.BrokerService - ActiveMQ JMS
Message Broker (localhost, ID:hostaname-2162-1241716219877-0:0) started
10:10:39.705 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:10:39.705 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:10:49.705 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
dataFilesInProgress.values: (0) []
10:10:49.705 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
lastDataFile: 1
10:10:49.705 [ActiveMQ Scheduler] DEBUG o.a.a.k.impl.async.AsyncDataManager
- lastFileId=0, purgeList: (0) []
10:10:59.720 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:10:59.720 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:11:19.720 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
dataFilesInProgress.values: (0) []
10:11:19.720 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
lastDataFile: 1
10:11:19.720 [ActiveMQ Scheduler] DEBUG o.a.a.k.impl.async.AsyncDataManager
- lastFileId=0, purgeList: (0) []
10:11:19.720 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:11:19.720 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:11:39.719 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:11:39.719 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:11:49.719 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
dataFilesInProgress.values: (0) []
10:11:49.719 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
lastDataFile: 1
10:11:49.719 [ActiveMQ Scheduler] DEBUG o.a.a.k.impl.async.AsyncDataManager
- lastFileId=0, purgeList: (0) []
10:11:59.719 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:11:59.719 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:12:19.719 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
dataFilesInProgress.values: (0) []
10:12:19.719 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
lastDataFile: 1
10:12:19.719 [ActiveMQ Scheduler] DEBUG o.a.a.k.impl.async.AsyncDataManager
- lastFileId=0, purgeList: (0) []
10:12:19.719 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:12:19.719 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:12:39.718 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.
10:12:39.718 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint done.
10:12:49.718 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
dataFilesInProgress.values: (0) []
10:12:49.718 [ActiveMQ Scheduler] DEBUG o.a.a.s.amq.AMQPersistenceAdapter -
lastDataFile: 1
10:12:49.718 [ActiveMQ Scheduler] DEBUG o.a.a.k.impl.async.AsyncDataManager
- lastFileId=0, purgeList: (0) []
10:12:55.327 [main] INFO  o.a.activemq.broker.BrokerService - Using
Persistence Adapter: AMQPersistenceAdapter(data\localhost)
10:12:55.343 [main] WARN  o.a.a.s.amq.AMQPersistenceAdapter - Waiting to
Lock the Store data\localhost
10:12:59.718 [Persistence Adaptor Task] DEBUG
o.a.a.s.amq.AMQPersistenceAdapter - Checkpoint started.



My spring configuration is like this

<broker xmlns="http://activemq.apache.org/schema/core"
		brokerName="localhost" dataDirectory="data">

		<!--
			Destination specific policies using destination names or wildcards
		-->
		<destinationPolicy>
			<policyMap>
				<policyEntries>
					<policyEntry queue=">" memoryLimit="5mb" />
					<policyEntry topic=">" memoryLimit="5mb" />
				</policyEntries>
			</policyMap>
		</destinationPolicy>

		<!-- The transport connectors ActiveMQ will listen to -->
		<transportConnectors>
			<transportConnector name="tcp" uri="tcp://localhost:61616" />
		</transportConnectors>

	</broker>
	
	<!-- a pooling based JMS provider -->
	<bean id="springJmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory"
		destroy-method="stop">
		<property name="connectionFactory">
			<bean class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL">
					<value>vm://localhost?create=false&amp;waitForStart=5000</value>
				</property>
			</bean>
		</property>
	</bean>


I believe that the broker is actually being started for more than once. 
Possible theory that I could think of is that the broker is started with
default URL when the PooledConnectionFactory is instantiated by spring, when
the ActimeMQConnection is instantiated by spring the broker is being started
again with the default Broker URL.


I am pretty sure, someone out there would have implemented a similar spring
injection and this must be something wrong with my configuration.

Any suggestions of what could be going wrong here ?
-- 
View this message in context: http://www.nabble.com/Spring-injection-and-ActiveMQConnectionFactory-tp23431644p23431644.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message