oops. muy bad. I misread the stomp protocol. After removing the "subscribe" from the write.rb, Im able to receive all the messages. Thanks for the help
However, the messages, once read , are still being retained in the queue. Any suggestion on that one ? thanks. - Sandeep On Tue, 2006-08-01 at 14:54 +0100, James Strachan wrote: > why is write.rb subscribing to the queue as well? > > On 8/1/06, Sandeep Chayapathi <[EMAIL PROTECTED]> wrote: > > Hi, > > > > When I run both, write.rb and read.rb, the ConsumerCount for queue > > FOO.test is 2. Once write.rb is finished, the ConsumerCount drops to 1. > > > > - Sandep > > > > On Tue, 2006-08-01 at 14:41 +0100, James Strachan wrote: > > > If you look in JMX do you see just a single consumer? > > > > > > http://incubator.apache.org/activemq/jmx.html > > > > > > On 8/1/06, Sandeep Chayapathi <[EMAIL PROTECTED]> wrote: > > > > Hi all, > > > > > > > > This is a followup to my earlier mail regarding Stomp and the perl > > > > client. I have a simple producer and consumer, using ruby client. Im > > > > using AMQ 4.0.1. > > > > > > > > The problem is, every other message is missed by the consumer. > > > > Moreover, after a message has been consumed, it is not being removed > > > > from the queue. > > > > > > > > Im not able to figure out what the issue is. Any help is greatly > > > > appreciated. Thanks in advance. > > > > > > > > Here is the destination policy being used: > > > > > > > > ---- activemq.xml ---- > > > > <destinationPolicy> > > > > <policyMap><policyEntries> > > > > > > > > <policyEntry topic="FOO.>"> > > > > <dispatchPolicy> > > > > <strictOrderDispatchPolicy /> > > > > </dispatchPolicy> > > > > <subscriptionRecoveryPolicy> > > > > <lastImageSubscriptionRecoveryPolicy /> > > > > </subscriptionRecoveryPolicy> > > > > </policyEntry> > > > > > > > > </policyEntries></policyMap> > > > > </destinationPolicy> > > > > ----------------------- > > > > > > > > > > > > Here is the code: > > > > > > > > ---- read.rb ------ > > > > #!/usr/bin/env ruby > > > > require 'stomp' > > > > > > > > client = Stomp::Connection.new("test","user") > > > > > > > > client.subscribe "/queue/FOO.test" > > > > > > > > while TRUE > > > > puts "sleeping" > > > > sleep 0.01 > > > > msg = client.receive > > > > puts msg.body > > > > end > > > > -------------------- > > > > > > > > > > > > ---- write.rb ------ > > > > #!/usr/bin/env ruby > > > > require 'stomp' > > > > > > > > client = Stomp::Connection.new("test","user") > > > > > > > > client.subscribe "/queue/FOO.test" > > > > > > > > > > > > > > > > for i in 0..10 > > > > sleep 1 > > > > client.send "/queue/FOO.test", "[Ruby] message " + i.to_s > > > > puts "[Ruby] message " + i.to_s > > > > end > > > > > > > > client.disconnect > > > > --------------------- > > > > > > > > > > > > > > > > > > > >
