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:
[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
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.
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.