[ 
https://issues.apache.org/activemq/browse/AMQ-2439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54579#action_54579
 ] 

Hiram Chirino commented on AMQ-2439:
------------------------------------

How to reproduce:
Start broker 1 with config:
{code:xml}
<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.xsd";>

    <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.base}/conf/credentials.properties</value>
        </property>
    </bean>

    <broker xmlns="http://activemq.apache.org/schema/core";  
brokerName="activemq1" dataDirectory="${activemq.base}/data">
        <networkConnectors>
                <networkConnector
                        uri="static://(tcp://localhost:61617)"
                        name="Connection to 61617"
                        dynamicOnly="true"/>

        </networkConnectors>
        <persistenceAdapter>
                <kahaDB directory="${activemq.base}/data/kaha" 
journalMaxFileLength="32mb"/>
        </persistenceAdapter>
        <systemUsage>
          <systemUsage>
            <memoryUsage>
              <memoryUsage limit="50 mb" />
            </memoryUsage>
            <storeUsage>
              <storeUsage limit="4 gb" />
            </storeUsage>
            <tempUsage>
              <tempUsage limit="200 mb" />
            </tempUsage>
          </systemUsage>
        </systemUsage>
        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
        </transportConnectors>

    </broker>
        <jetty xmlns="http://mortbay.com/schemas/jetty/1.0";>
        <connectors>
            <nioConnector port="8161"/>
        </connectors>

        <handlers>
            <webAppContext contextPath="/admin" 
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
        </handlers>
    </jetty>

</beans>
{code}

and broker 2 with config:
{code:xml}
<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.xsd";>

    <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.base}/conf/credentials.properties</value>
        </property>
    </bean>

    <broker xmlns="http://activemq.apache.org/schema/core";  
brokerName="activemq2" dataDirectory="${activemq.base}/data">
        <networkConnectors>
                <networkConnector
                        uri="static://(tcp://localhost:61616)"
                        name="Connection to 61616"
                        dynamicOnly="true"/>

        </networkConnectors>
        <persistenceAdapter>
                <kahaDB directory="${activemq.base}/data/kaha" 
journalMaxFileLength="32mb"/>
        </persistenceAdapter>
        <systemUsage>
          <systemUsage>
            <memoryUsage>
              <memoryUsage limit="50 mb" />
            </memoryUsage>
            <storeUsage>
              <storeUsage limit="4 gb" />
            </storeUsage>
            <tempUsage>
              <tempUsage limit="200 mb" />
            </tempUsage>
          </systemUsage>
        </systemUsage>
        <transportConnectors>
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61617"/>
        </transportConnectors>

    </broker>
        <jetty xmlns="http://mortbay.com/schemas/jetty/1.0";>
        <connectors>
            <nioConnector port="8162"/>
        </connectors>

        <handlers>
            <webAppContext contextPath="/admin" 
resourceBase="${activemq.base}/webapps/admin" logUrlOnStart="true"/>
        </handlers>
    </jetty>

</beans>
{code}

Use the example producer and consumer in the distribution examples dir:
{code}
ant producer -Durl=tcp://localhost:61616  -Dtopic=false -Ddurable=true 
-Dmax=1000
{code}
{code}
ant consumer -Durl=tcp://localhost:61617 -Dtopic=false -Ddurable=true -Dmax=500
{code}

run the producer once.
run that consumer 2 times.
then restart the broker on port 61617
and run the consumer again.

The 3rd run of the consumer should get no messages but it receives multiple 
messages.  What's worse is that restarting the broker and consumer will result 
in the same duplicates getting delivered again.

> KahaDB + Network of Brokers + Restart = Duplicate Messages that cannot be 
> removed from the data store
> -----------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2439
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2439
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Message Store
>            Reporter: Hiram Chirino
>            Assignee: Hiram Chirino
>             Fix For: 5.3.0
>
>
> Every time the broker is restarted, the same set of duplicate messages get 
> redelivered to consumers.

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

Reply via email to