Yes. I feel this is an error & not expected behavior. The first message was processed successfully by my consumer at 12:04:11.002 PM. There were no network or database issues or failover which took place between 12:04 to 12:21. At 12:22, I restart Active MQ and immediately lots of such messages get replayed automatically. The producer did not send the dupe messages. I confirmed looking at the log file. Always we connect to the 1st broker. I am using Spring configuration as shown below. All consumers connect to broker 1. Reading the different configuration, I am not sure if I have to use enableAudit="true" in activemq.xml or add jms.optimizeAcknowledge=true in my brokerURL below.
Can I check the ACTIVEMQ_MSGS table before I restart to check what are the messages in the container queue://Input and do I need to truncate this table before every restart? Can you provide me some guidance on the settings? Thanks <bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL"> <value>failover:(${stp.jms.broker1.uri},${stp.jms.broker2.uri})?randomize=false&jms.prefetchPolicy.queuePrefetch=1&maxReconnectAttempts=-1</value> </property> </bean> <bean id="jmsFactory" class="org.springframework.jms.connection.CachingConnectionFactory"> <constructor-arg ref="connectionFactory"/> </bean> <bean id="listener" class="org.springframework.jms.listener.adapter.MessageListenerAdapter"> <property name="delegate" ref="consumer"/> <property name="defaultListenerMethod" value="onMessage"/> </bean> <bean id="container" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="connectionFactory" ref="jmsFactory2"/> <property name="concurrentConsumers" value="5"/> <property name="maxConcurrentConsumers" value="10"/> <property name="recoveryInterval" value="1500"/> <property name="messageListener" ref="listener"/> <property name="destination" ref="destQueue"/> <property name="sessionTransacted" value="true"/> <property name="exceptionListener" ref="consumer"/> </bean> -- View this message in context: http://activemq.2283324.n4.nabble.com/Duplicate-messages-sent-in-Active-MQ-5-7-tp4675063p4675139.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.