You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jianxiac <ji...@gmail.com> on 2007/04/05 23:16:48 UTC

AMQ 4.1 loses every other message?


I am running the web-demo example with the REST interface, 
and it seems I can only receive every other posted messages. Here are
the simple scripts I used to do the test: 

First, I posted 10 messages with this script: 

[me@a ~]$ cat run-post.sh
#! /bin/sh

ip=10.0.0.3

for i in `seq -w 1 10`; do

echo Posting msg $i:
cat > post-data.txt <<EOF
destination=FOO.BAR&type=topic&body=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0D%0A++%3Ctitle%3EMsg+no.+$i%3C%2Ftitle%3E%0D%0A+
EOF

wget -O tmp.out -o /dev/null --post-file post-data.txt
http://$ip:8080/activemq-web-demo/message/FOO/BAR

done

And it ran fine, 

[me@a ~]$ ./run-post.sh
Posting msg 01:
Posting msg 02:
Posting msg 03:
Posting msg 04:
Posting msg 05:
Posting msg 06:
Posting msg 07:
Posting msg 08:
Posting msg 09:
Posting msg 10:

The I fired up a message read script, shown here:

[me@a ~]$ cat run-read.sh
#! /bin/sh
ip=10.0.0.3

# wget -O - --save-cookies cookies --keep-session-cookies
http://$ip:8080/activemq-web-demo/message/FOO/BAR?timeout=10000\&type=topic

for i in `seq -w 1 10`; do

echo Getting msg $i:
wget -O - -o /dev/null --load-cookies cookies
http://$ip:8080/activemq-web-demo/message/FOO/BAR?timeout=10000\&type=topic

done

But when it ran, it had: 

[me@a ~]$ ./run-read.sh
Getting msg 01:

  <title>Msg no. 01</title>

Getting msg 02:

  <title>Msg no. 03</title>

Getting msg 03:

  <title>Msg no. 05</title>

Getting msg 04:

  <title>Msg no. 07</title>

Getting msg 05:

  <title>Msg no. 09</title>

Getting msg 06:

Then it stuck there until timeout. So apparently it only got the
odd-numbered message in 
the topic. Sometimes it got all the even-numbered ones. But it never got 'em
all. 

Jconsole showed there is only one consumer. 

I am wondering if others have similar issue. 

Thanks.





-- 
View this message in context: http://www.nabble.com/AMQ-4.1-loses-every-other-message--tf3533954s2354.html#a9864016
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ 4.1 loses every other message? -- still fails

Posted by jianxiac <ji...@gmail.com>.
Thanks for the reply. I poked around, and did not see any indication of 
2nd broker running. 

Then instead of running the web-demo example out of box, I started a
standalone 
activeMQ, and configured jetty to talk to it via tcp://localhost:61616
instead of 
vm://localhost, and still the same message loss problem. I did see tcp
connections
between the two java processes, so the message did seem to go to the 
standalone broker. 

This problem can be seen with the bundled example too, 

If you send messages with this page:
http://yourip:8080/activemq-web-demo/send.html

and receive with this url with your browser: 
http://yourip:8080/activemq-web-demo/message/FOO/BAR?timeout=10000&type=queue

It works fine if you send one message, then receive one, and so on. 
But if you send 10 messages in a row, then start receiving them, then you 
will only get half of them. 

 I start to suspect there may be something in the messageServlet. 

Thanks.
jianxiac

-- 
View this message in context: http://www.nabble.com/AMQ-4.1-loses-every-other-message--tf3533954s2354.html#a9907758
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ 4.1 loses every other message? -- still fails

Posted by jianxiac <ji...@gmail.com>.

Thanks for the reply. I poked around, and did not see any indication of 
2nd broker running. 

Then instead of running the web-demo example out of box, I started a
standalone 
activeMQ, and configured jetty to talk to it via tcp://localhost:61616
instead of 
vm://localhost, and still the same message loss problem. I did see tcp
connections
between the two java processes, so the message did seem to go to the 
standalone broker. 

 I start to suspect there may be something in the messageServlet. 

Thanks.
jianxiac

-- 
View this message in context: http://www.nabble.com/AMQ-4.1-loses-every-other-message--tf3533954s2354.html#a9907756
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ 4.1 loses every other message? -- still fails

Posted by jianxiac <ji...@gmail.com>.

Thanks for the reply. I poked around, and did not see any indication of 
2nd broker running. 

Then instead of running the web-demo example out of box, I started a
standalone 
activeMQ, and configured jetty to talk to it via tcp://localhost:61616
instead of 
vm://localhost, and still the same message loss problem. I did see tcp
connections
between the two java processes, so the message did seem to go to the 
standalone broker. 

 I start to suspect there may be something in the messageServlet. 

Thanks.
jianxiac

-- 
View this message in context: http://www.nabble.com/AMQ-4.1-loses-every-other-message--tf3533954s2354.html#a9907758
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ 4.1 loses every other message?

Posted by Mario Siegenthaler <ma...@gmail.com>.
> [.. broker 'losing' every 2nd message.. ]
Oh I just thought of another possible cause (related to the first one): You
might also startup a second broker named localhost (vm://localhost) if you
have renamed you actual broker to something else and use the WebClient.
There's some (IMO weird) code within the WebClient that will use
vm://localhost under some conditions, which will result in a second broker
beeing started.

Hope it helps
Mario

Re: AMQ 4.1 loses every other message?

Posted by Mario Siegenthaler <ma...@gmail.com>.
> I am running the web-demo example with the REST interface,
> and it seems I can only receive every other posted messages. Here are
> the simple scripts I used to do the test:

Do you use a single broker are have you (maybe accidentally due to
auto-discovery) configured a network of brokers? We've had the same
behaviour using the ant producer/consumer with a network of brokers (see
configuration pitfall under the network of broker wiki-page).

Greetz
Mario