2 Replies Latest reply on Jul 6, 2010 3:00 PM by townsfolk

    Duplicate Message errors = missing messages.

    townsfolk

      Hello,

         I've been playing around with the HornetQ (2.1.0.final) examples, in particular the "clustered-queue" example, and I've noticed that when I get errors for duplicate messages:

      [quote]

      [java] HornetQServer_0 err:[Old I/O server worker (parentId: 1317923722, channelId: 1147055517, null => localhost/127.0.0.1:5445)] 16:42:08,320 WARNING [org.hornetq.core.postoffice.impl.PostOfficeImpl]  Duplicate message detected - message will not be routed

      [/quote]

       

      This results in a missing message for each duplicate message error.

       

      What I've done is to modify the ClusteredQueueExample.java file to close consumer1 half way through processing the messages on the queue.

      Eg. I've set the total numMessages to 500, and after the 250th message is received, I call consumer1.close(), and connection1.close().

       

      I'm trying to simulate the situation where a consumer vanishes suddenly. I want to ensure that the remaining consumers will pick up all remaining messages.

       

      To accomplish this, I've made the queues in both server's durable, and set use-duplicate-detection and forward-when-no-consumers to false under the cluster-connection. I've also added an address-settings section under hornetq-configuration.xml.

      [quote]

      <address-settings>

         <address-setting match="jms.queue.exampleQueue">

            <max-delivery-attempts>10</max-delivery-attempts>

            <redelivery-delay>5000</redelivery-delay>

            <last-value-queue>true</last-value-queue>

            <max-size-bytes>100000</max-size-bytes>

            <page-size-bytes>20000</page-size-bytes>

            <redistribution-delay>0</redistribution-delay>

            <send-to-dla-on-no-route>true</send-to-dla-on-no-route>

            <address-full-policy>PAGE</address-full-policy>

         </address-setting>

      </address-settings>

      [/quote]

       

      When I run the example with my changes, I can see that I'm missing some messages and the number of missing messages equals the duplicate message errors I receive.

       

      I'm not sure what properties/settings I need to set to fix this. Any help would be greatly appreciated.

       

      Thanks,

      Eric