activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Chayapathi <sand...@wssource.com>
Subject Stomp - message woes - Ruby client
Date Tue, 01 Aug 2006 13:35:44 GMT
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
---------------------


Mime
View raw message