Loading ...
Sorry, an error occurred while loading the content.
 

reliable messaging with rails

Expand Messages
  • ginanjar_utama
    http://trac.labnotes.org/cgi-bin/trac.cgi/wiki/Ruby/ReliableMessaging/Rails http://blog.labnotes.org/tag/ruby mudah-mudahan aja ada waktu untukku mencobanya
    Message 1 of 1 , Feb 7, 2006
      http://trac.labnotes.org/cgi-bin/trac.cgi/wiki/Ruby/ReliableMessaging/Rails
      http://blog.labnotes.org/tag/ruby
      mudah-mudahan aja ada waktu untukku mencobanya .....

      ketemu di
      http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/172958
      Or you can try:
      http://rubyforge.org/projects/reliable-msg/

      Lightweight reliable messaging in Ruby, support for disk and database
      store (right now MySQL, but I'm moving the code to use ActiveRecords),
      message selectors, priority queues, delivery semantics, transactions.

      assaf


      atau pake stomp, cuma kayaknya lebih enteng yang reliable-msg
      soalnya nggak perlu install JDK :)

      dari http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165089


      Stomp is a text-oriented wire protocol for messaging (MOM/MQ/JMS)
      type systems. This library provides two useful interfaces, a low-
      level class, Stomp::Connection, which is a basic protocol
      implementation, and Stomp::Client, which is designed as a higher
      level convenience API. More information is available at http://
      stomp.codehaus.org/

      This library is a client for the Stomp protocol. A couple servers
      exist, the most mature probably being ActiveMQ ( http://
      activemq.codehaus.org ) and Gozirra ( http://www.germane-software.com/
      software/Java/Gozirra/ ).

      While this release is labeled 1.0.0, it is not highly tested yet, so
      bug reports are much appreciated!

      -Brian

      Installation via gems:
      $ gem install stomp

      Some sample code:

      #!/usr/bin/env ruby -w
      require 'rubygems'
      require 'stomp'

      # username, password, host, port
      c = Stomp::Client.open "brianm", "s3kr3t", "localhost", 61613

      # block will be called for each message received from the destination
      c.subscribe "/queue/sample" do |message|
      puts "received: #{message.body} on #{message.headers['destination']}"
      end

      # send a bunch of stuff (which we will receive)
      for i in 1..5 do
      c.send "/queue/sample", "Hello world #{i}!"
      end

      # wait (not very long) for delivery
      gets

      # done!
      c.close


      wassalam,
      Ginanjar Utama
    Your message has been successfully submitted and would be delivered to recipients shortly.