Do the queues disappear or the messages in the queues?
What delivery mode is your producer using?

BTW in your broker configuration below, you start a comment w/in the
<persistenceAdapter> element, but you don't end it properly. 

<persistenceAdapter>
   <!--
     ... 

Joe
www.ttmsolutions.com
 

Tung.Nguyen wrote:
> 
> Dear all,
> 
> i use embedded ActiveMQ in my web application. I found that queues always
> delete and create new when i stop and restart web application. It means
> that all message in the queue is lost after restarting...
> 
> Could you please help me to resolve this problem???
> Here is my broker's configuration:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>       xmlns:amq="http://activemq.apache.org/schema/core";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";   
>       xsi:schemaLocation="http://www.springframework.org/schema/beans 
>         http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>         http://activemq.apache.org/schema/core 
>               http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd 
> ">
>               
>     <!--=========== Create an embedded ActiveMQ Broker  ===============-->
>     <broker xmlns="http://activemq.apache.org/schema/core"; 
>               brokerName="localhost"                          
>                       useJmx="true"                   
>                       persistent="true"
>                       dataDirectory="${activemq.base}"
>                       dataDirectoryFile="${activemq.base}/files"
>                       tmpDataDirectory="${activemq.base}/temp"
>                       deleteAllMessagesOnStartup="false">
>                       
>               <!-- Destination specific policies using destination names or 
> wildcards
> -->
>               <destinationPolicy>
>                       <policyMap>
>                               <policyEntries>
>                                       <policyEntry queue=">" 
> memoryLimit="20mb"/>                                     
>                                       <policyEntry topic=">" 
> memoryLimit="10mb">
>                                               <dispatchPolicy>
>                                                       
> <strictOrderDispatchPolicy />
>                                               </dispatchPolicy>
>                                               <subscriptionRecoveryPolicy>
>                                                       
> <lastImageSubscriptionRecoveryPolicy />
>                                               </subscriptionRecoveryPolicy>
>                                       </policyEntry>
>                               </policyEntries>
>                       </policyMap>
>               </destinationPolicy>
>                
>               <!-- Use the following to configure how ActiveMQ is exposed in 
> JMX -->
>               <managementContext>
>                       <managementContext createConnector="true" />
>               </managementContext>
>               
>               <persistenceAdapter>
>                       <!-- 
>                       <journaledJDBC journalLogFiles="5"  
> dataDirectory="${activemq.base}"
> createTablesOnStartup="false"/>
>               </persistenceAdapter>
> 
>               <transportConnectors>
>                       <transportConnector name="openwire" 
> uri="${activemq.trans.tcp}"
> discoveryUri="multicast://default"/>
>                       <transportConnector name="VM" 
> uri="${activemq.trans.vm}"/>
>               </transportConnectors>
>       </broker>
>       
>       <!-- JMS ConnectionFactory to use, configuring the embedded broker using
> XML -->       
>       <amq:connectionFactory id="activeMQJmsFactory"
> brokerURL="${jms.broker.url}"/>       
>        
>       <!-- connection factory to ActiveMQ -->
> 
>       <!-- ###### Transaction manager ###### -->
>       <bean id="jmsTransactionManager"
> class="org.jencks.factory.TransactionManagerFactoryBean"
> destroy-method="destroy"/>
>        
>       <bean id="jmsConnectionFactory"
> class="org.jencks.amqpool.XaPooledConnectionFactory"
> destroy-method="stop">
>         <property name="connectionFactory" ref="activeMQJmsFactory"/>
>         <property name="maxConnections" value="8" /> 
>         <property name="transactionManager" ref="jmsTransactionManager" />
>       </bean>
> </beans>    
> 

-- 
View this message in context: 
http://www.nabble.com/Lost-message-queue-when-stoping-and-restarting-Embedded-ActiveMQ-tp18727598p18733755.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to