-
-
Save hassox/307122 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'amqp' | |
| require 'mq' | |
| EM.error_handler {|e| | |
| p [:exception, e] | |
| } | |
| EM.run do | |
| AMQP.start | |
| q = MQ.queue("failure_test", :auto_delete => true) | |
| EM.add_periodic_timer(1) do | |
| msg = Time.now.to_s | |
| puts "Publishing: #{msg.inspect}" | |
| q.publish(msg) | |
| end | |
| q.subscribe do |msg| | |
| puts "Received: #{msg.inspect}" | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # When starting with no rabbit up | |
| ∴ ruby failover_test.rb | |
| [:exception, #<AMQP::Error: Could not connect to server 127.0.0.1:5672>] | |
| Publishing: "Thu Feb 18 10:14:06 +1100 2010" | |
| Publishing: "Thu Feb 18 10:14:07 +1100 2010" | |
| Publishing: "Thu Feb 18 10:14:08 +1100 2010" | |
| Publishing: "Thu Feb 18 10:14:09 +1100 2010" | |
| Publishing: "Thu Feb 18 10:14:10 +1100 2010" | |
| Publishing: "Thu Feb 18 10:14:11 +1100 2010" | |
| Publishing: "Thu Feb 18 10:14:12 +1100 2010" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Killing rabbit part way through and then re-starting it | |
| ∴ ruby failover_test.rb | |
| Publishing: "Thu Feb 18 10:15:42 +1100 2010" | |
| Received: "Thu Feb 18 10:15:42 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:44 +1100 2010" | |
| Received: "Thu Feb 18 10:15:44 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:45 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:46 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:47 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:48 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:49 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:50 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:51 +1100 2010" | |
| Received: "Thu Feb 18 10:15:46 +1100 2010" | |
| Received: "Thu Feb 18 10:15:47 +1100 2010" | |
| Received: "Thu Feb 18 10:15:48 +1100 2010" | |
| Received: "Thu Feb 18 10:15:49 +1100 2010" | |
| Received: "Thu Feb 18 10:15:50 +1100 2010" | |
| Received: "Thu Feb 18 10:15:51 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:52 +1100 2010" | |
| Received: "Thu Feb 18 10:15:52 +1100 2010" | |
| Publishing: "Thu Feb 18 10:15:53 +1100 2010" | |
| Received: "Thu Feb 18 10:15:53 +1100 2010" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment