activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsahadevan <priyavira...@gmail.com>
Subject ActiveMQ Embedded with Tomcat missing messages while restart
Date Wed, 31 May 2017 16:08:27 GMT
Hi All,

Thanks in Advance.

We have an ActiveMQ embedded running Tomcat with spring configuration. After
Tomcat server restarts few records from the persisted queue are getting
missed out. Below is my spring config. It seems the issue may be ActiveMQ
embedded starting faster than tomcat and is not getting Hibernate connection
for database. Could you please advise. While restart I am getting error like
this
java.lang.NullPointerException
	at
org.codehaus.groovy.grails.orm.hibernate.transaction.PlatformTransactionManagerProxy.getTransaction(PlatformTransactionManagerProxy.java:22)

	<bean id="persistenceAdapter"
class="org.apache.activemq.store.jdbc.JDBCPersistenceAdapter">
        <property name="dataSource" ref="dataSource"/>
        <property name="lockKeepAlivePeriod" value="2000"/>
        <property name="createTablesOnStartup" value="false"/>
    </bean>
	<bean id="broker" class="org.apache.activemq.broker.BrokerService">
		<property name="useJmx" value="false" />
		<property name="persistent" value="true" />
		<property name="persistenceAdapter" ref="persistenceAdapter"/>  
		<property name="transportConnectors">
			<list>
				<ref bean="tcpConnector" />
				<ref bean="vmConnector" />
			</list>
		</property>
	</bean>
	
	<bean id="tcpConnector"
class="org.apache.activemq.broker.TransportConnector">
   		<property name="uri" value="tcp://localhost:61616"></property>
   	</bean>
   	<bean id="vmConnector"
class="org.apache.activemq.broker.TransportConnector">
   		<property name="uri" value="vm://localhost"></property>
   	</bean>

    
    <bean id="jmsConnectionFactory"
         
class="org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy">
        <property name="targetConnectionFactory">
            <bean class="org.apache.activemq.pool.PooledConnectionFactory"
destroy-method="stop">
                <property name="connectionFactory">
                    <bean
class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="broker">
                        <property name="brokerURL" value="vm://localhost"/>
                    </bean>
                </property>
            </bean>
        </property>
        <property name="synchedLocalTransactionAllowed" value="true" />
    </bean>

    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory">
            <ref local="jmsConnectionFactory"/>
        </property>
        <property name="sessionTransacted" value="true" />
    </bean>

Regards
Viraj



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Embedded-with-Tomcat-missing-messages-while-restart-tp4726828.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message