activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <>
Subject Re: Network of Brokers - Duplicate message add attempt rejected
Date Tue, 06 Sep 2011 09:43:05 GMT
With not persistent messages, the default producer sent mode is async.
This non guaranteed delivery mode is honored by the network connector,
it also does an async send when it forwards the message.
The thinking being that if it is ok to loose messages on a network
disconnect between client and broker, it is also ok to loose message
broker to broker.

Using AlwaysSyncSend, the producer waits for a broker ack, so it does
a sync send, which is in turn honored by the network connector, so any
inflight messages will be redelivered. They will be duplicates if it
is just the broker ack that is lost.

With the socket proxy, the connection closure is more controlled than
with netsh so the possibility of writes buffering up on a dead
connection are reduced.

On 5 September 2011 11:17, oseymen <> wrote:
> Hi Gary,
> I downloaded the source, compiled and ran the test - indeed it works
> perfectly fine. In order to understand where the problem is, I started to
> make changes one at a time:
> 1. I replaced HUB with a clean deployment of AMQ 5.5 on a remote virtual
> machine - no modifications to activemq.xml. So SPOKE is running locally in
> the unit test and HUB is a physical broker. The only reason I did this is to
> start/stop network myself as well (together with SocketProxy).
> 2. Made necessary (simple) changes to attached classes in order to bridge
> SPOKE with new-HUB.
> Test always runs successfully when I am using SocketProxy alone. However
> when I start/stop the network manually as the test is running, I see two
> different results:
> IF ConnectionFactory.AlwaysSyncSend is true, duplicate messages are reported
> on the HUB.
> IF ConnectionFactory.AlwaysSyncSend is false, number of messages that arrive
> in the HUB are less than number of messages sent.
> The windows commands I use to start/stop network are:
> netsh interface set interface "Local Area Connection" DISABLED
> netsh interface set interface "Local Area Connection" ENABLED
> I have no idea why I don't get the same results with SocketProxy but I can
> reproduce this whenever I run the test and play with network.
> I am attaching the test files that I modified here for your perusal. My
> changes are really simple and only to bridge a physical broker with internal
> SPOKE. I am happy to provide any other information you require or try any
> setting you suggest.
> Regards,
> Ozan
> --
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at


View raw message