You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by oseymen <oz...@tdpg.com> on 2011/06/19 18:59:00 UTC

Composite Queues - Losing Messages

Hi, 

Please see below and advise whether you want me to create JIRA for it. 

My setup: 
Producer -> Q.IN.DC1 (compositeQueue) -> DB.DC1 & SI.DC1 

I am losing messages in composite queues every time if: 
1. Producer sends persistent messages 
2. Producer is not using transactions 
3. Broker is using the failover transport to single broker 
3. Broker is killed in the middle 

I can replicate this every time I run this test: 
1. Start broker 
2. Start producer which starts sending 3000 persistent messages to Q.IN.DC1. 
3. Kill the broker (broker is running in console - I am just hitting close
in console) 
4. Restart broker 
5. Wait for 3000 messages to be forwarded. In the end you will see that one
of the queues has 3000 messages, the other has less messages (2997 in my
last run). 

My simple code, broker configuration and log file attached. 

In the log file attached, search for
ID:HAM-NB-073-58297-634440943864257972-1:0:1:1:270. This is the message id
that got dequeued from Q.IN.DC1, enqueued in DB.DC1 and never got to SI.DC1. 

Up until line 4845 everything is fine. Messages were forwarded to DB and SI
queues. In line 4845, message with ID 270 is sent to the broker. Broker
pushed the message in DB.DC1 but before it forwarded the message to SI.DC1,
broker got restarted. 

Jump to line 5395, now broker is restarted but it is suppressing the message
saying: 
"suppressing duplicate message send
[ID:HAM-NB-073-58297-634440943864257972-1:0:1:1:270]". 

So message #270 got forwarded to DB.DC1 but never reached SI.DC1. Message
also does not exist in Q.IN.DC1, so it's lost. 

Am I missing something? I thought composite queues were forwarding messages
in an atomic operation and producer was supposed to get notified by the
broker if messages are not persisted properly. 

Because I am using failover transport, Send() waits until broker is live
again. No notifications or exceptions are thrown back to my code so that I
can try to resend the message. 

http://activemq.2283324.n4.nabble.com/file/n3609565/activemq.log.txt.zip
activemq.log.txt.zip 
http://activemq.2283324.n4.nabble.com/file/n3609565/activemq.xml
activemq.xml 
http://activemq.2283324.n4.nabble.com/file/n3609565/Producer.cs Producer.cs 

Regards, 
Ozan

--
View this message in context: http://activemq.2283324.n4.nabble.com/Composite-Queues-Losing-Messages-tp3609565p3609565.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Composite Queues - Losing Messages

Posted by Dejan Bosanac <de...@nighttale.net>.
Please raise a Jira. Also, a test case would help.


Regards
-- 
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Sun, Jun 19, 2011 at 6:59 PM, oseymen <oz...@tdpg.com> wrote:

> Hi,
>
> Please see below and advise whether you want me to create JIRA for it.
>
> My setup:
> Producer -> Q.IN.DC1 (compositeQueue) -> DB.DC1 & SI.DC1
>
> I am losing messages in composite queues every time if:
> 1. Producer sends persistent messages
> 2. Producer is not using transactions
> 3. Broker is using the failover transport to single broker
> 3. Broker is killed in the middle
>
> I can replicate this every time I run this test:
> 1. Start broker
> 2. Start producer which starts sending 3000 persistent messages to
> Q.IN.DC1.
> 3. Kill the broker (broker is running in console - I am just hitting close
> in console)
> 4. Restart broker
> 5. Wait for 3000 messages to be forwarded. In the end you will see that one
> of the queues has 3000 messages, the other has less messages (2997 in my
> last run).
>
> My simple code, broker configuration and log file attached.
>
> In the log file attached, search for
> ID:HAM-NB-073-58297-634440943864257972-1:0:1:1:270. This is the message id
> that got dequeued from Q.IN.DC1, enqueued in DB.DC1 and never got to
> SI.DC1.
>
> Up until line 4845 everything is fine. Messages were forwarded to DB and SI
> queues. In line 4845, message with ID 270 is sent to the broker. Broker
> pushed the message in DB.DC1 but before it forwarded the message to SI.DC1,
> broker got restarted.
>
> Jump to line 5395, now broker is restarted but it is suppressing the
> message
> saying:
> "suppressing duplicate message send
> [ID:HAM-NB-073-58297-634440943864257972-1:0:1:1:270]".
>
> So message #270 got forwarded to DB.DC1 but never reached SI.DC1. Message
> also does not exist in Q.IN.DC1, so it's lost.
>
> Am I missing something? I thought composite queues were forwarding messages
> in an atomic operation and producer was supposed to get notified by the
> broker if messages are not persisted properly.
>
> Because I am using failover transport, Send() waits until broker is live
> again. No notifications or exceptions are thrown back to my code so that I
> can try to resend the message.
>
> http://activemq.2283324.n4.nabble.com/file/n3609565/activemq.log.txt.zip
> activemq.log.txt.zip
> http://activemq.2283324.n4.nabble.com/file/n3609565/activemq.xml
> activemq.xml
> http://activemq.2283324.n4.nabble.com/file/n3609565/Producer.csProducer.cs
>
> Regards,
> Ozan
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Composite-Queues-Losing-Messages-tp3609565p3609565.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>