amqp 0.8.0.rc11 → 0.8.0.rc12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/CHANGELOG +1 -0
  2. data/Gemfile +2 -1
  3. data/amqp.gemspec +1 -1
  4. data/docs/ConnectingToTheBroker.textile +136 -6
  5. data/docs/GettingStarted.textile +2 -2
  6. data/docs/Queues.textile +14 -14
  7. data/examples/channels/open_channel_with_one_arity_callback.rb +30 -0
  8. data/examples/deprecated/default_thread_local_channel_instance.rb +34 -0
  9. data/examples/error_handling/channel_level_exception.rb +1 -1
  10. data/examples/error_handling/channel_level_exception_with_multiple_channels_involved.rb +1 -1
  11. data/examples/error_handling/global_channel_level_exception_handler.rb +1 -1
  12. data/examples/guides/getting_started/03_babblr.rb +1 -1
  13. data/examples/guides/queues/05_binding_a_queue_using_exchange_instance.rb +1 -1
  14. data/examples/guides/queues/06_biding_a_queue_using_exchange_name_string.rb +1 -1
  15. data/examples/guides/queues/07_subscribing_to_receive_messages.rb +1 -1
  16. data/examples/guides/queues/08_poll_for_messages.rb +1 -1
  17. data/examples/guides/queues/09_unsubscribing_a_consumer.rb +1 -1
  18. data/examples/guides/queues/10_unbinding_from_exchange.rb +1 -1
  19. data/examples/guides/queues/11_purge_a_queue.rb +1 -1
  20. data/examples/guides/queues/12_deleting_a_queue.rb +1 -1
  21. data/examples/queues/declare_a_queue_without_assignment.rb +1 -1
  22. data/examples/queues/declare_and_bind_a_server_named_queue.rb +1 -1
  23. data/lib/amqp/channel.rb +27 -1
  24. data/lib/amqp/client.rb +36 -8
  25. data/lib/amqp/connection.rb +6 -3
  26. data/lib/amqp/deprecated/mq.rb +0 -22
  27. data/lib/amqp/queue.rb +19 -13
  28. data/lib/amqp/version.rb +1 -1
  29. data/spec/integration/authentication_spec.rb +7 -5
  30. data/spec/spec_helper.rb +1 -0
  31. data/spec/unit/amqp/client_spec.rb +149 -0
  32. data/spec/unit/amqp/connection_spec.rb +20 -0
  33. metadata +108 -86
data/CHANGELOG CHANGED
@@ -1,5 +1,6 @@
1
1
  = Version 0.8.0
2
2
 
3
+ * [API] Connection URI (string) format for vhosts no longer assumes that vhosts begin with a slash (/), learn more at http://bit.ly/mfzwcB
3
4
  * [FEATURE] Returned messages, including header & content via AMQP::Exchange#on_publish. Callback accepts 3 args: basic_return, header, body
4
5
  * [BUG] Ruby 1.8.7-p249 is not supported because of this (p249-specific) Ruby bug: http://bit.ly/iONBmH
5
6
  * [FEATURE] AMQP::Utilities::EventLoopHelper detects app server (if any) being used and starts EventMachine reactor in an optimal way.
data/Gemfile CHANGED
@@ -19,7 +19,7 @@ custom_gem "amq-client", :git => "git://github.com/ruby-amqp/amq-client.git",
19
19
  custom_gem "amq-protocol", :git => "git://github.com/ruby-amqp/amq-protocol.git", :branch => "master"
20
20
 
21
21
  group(:development) do
22
- gem "yard"
22
+ gem "yard", ">= 0.7.0"
23
23
  # yard tags this buddy along
24
24
  gem "RedCloth"
25
25
 
@@ -29,6 +29,7 @@ group(:development) do
29
29
  # To test event loop helper and various Rack apps
30
30
  gem "thin"
31
31
  gem "unicorn", :platform => :ruby
32
+ gem "changelog"
32
33
  end
33
34
 
34
35
  group(:test) do
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
 
23
23
  # Dependencies
24
24
  s.add_dependency "eventmachine"
25
- s.add_dependency "amq-client", ">= 0.7.0.alpha23"
25
+ s.add_dependency "amq-client", ">= 0.7.0.alpha25"
26
26
 
27
27
  begin
28
28
  require "changelog"
@@ -23,8 +23,86 @@ server and code required to establish connection to AMQP broker needs to be a li
23
23
  bit different.
24
24
 
25
25
 
26
+ h2. Two ways to specify connection parameters
26
27
 
27
- h2. In standalone applications
28
+ Connection parameters (host, port, username, vhost and so on) can be passed in two forms:
29
+
30
+ * As a hash
31
+ * As a connection URI string (à la JDBC)
32
+
33
+
34
+ h3. Using a hash
35
+
36
+ Hash options amqp gem will recognize are
37
+
38
+ * :host
39
+ * :port
40
+ * :username (aliased as :user)
41
+ * :password (aliased as :pass)
42
+ * :vhost
43
+ * :ssl
44
+ * :timeout
45
+ * :frame_max
46
+
47
+ h4. Default parameters
48
+
49
+ Default connection parameters are
50
+
51
+ <pre>
52
+ <code>
53
+ {
54
+ :host => "127.0.0.1",
55
+ :port => 5672,
56
+ :user => "guest",
57
+ :pass => "guest",
58
+ :vhost => "/",
59
+ :ssl => false,
60
+ :frame_max => 131072
61
+ }
62
+ </code>
63
+ </pre>
64
+
65
+
66
+ h3. Using connection strings
67
+
68
+ It is possible to use connection URIs (à la JDBC) with amqp and amqps schemas, for example:
69
+
70
+ * amqp://dev.rabbitmq.com
71
+ * amqp://dev.rabbitmq.com:5672
72
+ * amqp://guest:guest@dev.rabbitmq.com:5672
73
+ * amqp://hedgehog:t0ps3kr3t@hub.megacorp.internal/production
74
+ * amqps://hub.megacorp.internal//
75
+
76
+ Two supported schemas are *amqp* and *amqps*. Default port for amqp is 5672. If port isn't given, and schema
77
+ is amqps, amqp gem will assume it has to connect to 5671, default port for amqps.
78
+
79
+ h4. Vhosts: naming schemas and parsing
80
+
81
+ AMQP 0.9.1 spec does not define what vhost naming scheme should be. RabbitMQ and Apache Qpid use different schemes
82
+ (Qpid said to have two) but the bottom line is: even though some brokers use / as the default vhost, it can be *any string*.
83
+ Host (and optional port) part must be separated from vhost (path component) with a slash character (/).
84
+
85
+ Here are some examples that demonstrate how {AMQP::Client.parse_connection_uri} parses out vhost from connection URI:
86
+
87
+ <pre>
88
+ <code>
89
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com") # => vhost is nil, so default (/) will be used
90
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com/") # => vhost is an empty string
91
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com//") # => vhost is /
92
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com//vault") # => vhost is /vault
93
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com/%2Fvault") # => vhost is /vault
94
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com/production") # => vhost is production
95
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com/a.b.c") # => vhost is a.b.c
96
+ AMQP::Client.parse_connection_uri("amqp://dev.rabbitmq.com///a/b/c/d") # => vhost is //a/b/c/d
97
+ </code>
98
+ </pre>
99
+
100
+ {AMQP::Client.parse_connection_uri} will also unescape path part of the URI.
101
+
102
+
103
+
104
+
105
+ h2. Starting event loop & connecting in standalone applications
28
106
 
29
107
  h3. EventMachine event loop
30
108
 
@@ -48,7 +126,7 @@ Standalone applications often can afford starting event loop on the main thread.
48
126
  recommended way.
49
127
 
50
128
 
51
- h3. AMQP.connect with a block
129
+ h3. Using AMQP.connect with a block
52
130
 
53
131
  Once event loop is running, {AMQP.connect} method will attempt to connect to the broker. It can be used in two ways. Here is the
54
132
  first one:
@@ -70,7 +148,7 @@ end
70
148
  authentication succeeded, broker and client finished negotiating connection parameters like max frame size).
71
149
 
72
150
 
73
- h3. AMQP.connect without a callback
151
+ h3. Using AMQP.connect without a callback
74
152
 
75
153
  Alternative way of connecting is this:
76
154
 
@@ -93,7 +171,8 @@ arise from attempts to use a connection object that is not fully opened yet. For
93
171
  with the block version, as we will see in the following sections.
94
172
 
95
173
 
96
- h3. AMQP.start
174
+
175
+ h3. Using AMQP.start
97
176
 
98
177
  EventMachine.run and {AMQP.connect} with a block is such a common combination that amqp gem provides a shortcut:
99
178
 
@@ -101,7 +180,7 @@ EventMachine.run and {AMQP.connect} with a block is such a common combination th
101
180
  <code>
102
181
  require "amqp"
103
182
 
104
- AMQP.start("amqp://dev.rabbitmq.com:5672/") do |client|
183
+ AMQP.start("amqp://dev.rabbitmq.com:5672") do |client|
105
184
  # connection is open and ready to be used
106
185
  end
107
186
  </code>
@@ -275,7 +354,7 @@ it means that authentication has failed.
275
354
 
276
355
 
277
356
 
278
- h2. In Web applications (Ruby on Rails, Sinatra, Merb, Rack)
357
+ h2. Starting event loop & connecting in Web applications (Ruby on Rails, Sinatra, Merb, Rack)
279
358
 
280
359
  Web applications are different from standalone applications in that main thread is occupied by Web/application server like Unicorn
281
360
  or Thin, so you need to start EventMachine reactor before you attempt to use {AMQP.connect}.
@@ -346,6 +425,57 @@ Thin and Goliath are not pre-forking servers so there is no need to re-establish
346
425
 
347
426
 
348
427
 
428
+
429
+ h2. If it just doesn't work: troubleshooting
430
+
431
+ If you read this guide yet your issue is still unresolved, check the following things before asking on the mailing list:
432
+
433
+ * AMQP broker log.
434
+ * List of users in a particular vhost you are trying to connect
435
+ * Network connectivity. We know, it's obvious, yet even experienced developers and devops engineers struggle with network access misconfigurations every once in a while.
436
+ * If EventMachine is started in a separate thread, make sure that isn't dead. If it is, this usually means there was an exception that caused it to terminate.
437
+
438
+
439
+ h3. Inspecting AMQP broker log file
440
+
441
+ In this section we will cover typical problems that can be tracked down by reading AMQP broker log. We will use RabbitMQ as an example, however, different AMQP brokers
442
+ often log most of the same issues.
443
+
444
+ RabbitMQ logs abrupt TCP connection failures, timeouts, protocol version mismatches and so on.
445
+ If you are running RabbitMQ, log locations for various operating systems and distributions is documented in the "RabbitMQ installation guide":http://www.rabbitmq.com/install.html
446
+
447
+ On Mac OS X, RabbitMQ installed via Homebrew logs to $HOMEBREW_HOME/var/log/rabbitmq/rabbit@$HOSTNAME.log. For example, if you have Homebrew installed at /usr/local and
448
+ your hostname is giove, log will be at /usr/local/var/log/rabbitmq/rabbit@giove.log.
449
+
450
+ Here is what authentication failure looks like in RabbitMQ log:
451
+
452
+ <pre>
453
+ =ERROR REPORT==== 17-May-2011::17:37:58 ===
454
+ exception on TCP connection <0.4770.0> from 127.0.0.1:46551
455
+ {channel0_error,starting,
456
+ {amqp_error,access_refused,
457
+ "AMQPLAIN login refused: user 'pipeline_agent' - invalid credentials",
458
+ 'connection.start_ok'}}
459
+ </pre>
460
+
461
+ This means that connection attempt with username pipeline_agent failed because credentials were invalid. If you are seeing this message, make sure username,
462
+ password *and vhost* are correct.
463
+
464
+
465
+ The following entry:
466
+
467
+ <pre>
468
+ =ERROR REPORT==== 17-May-2011::17:26:28 ===
469
+ exception on TCP connection <0.4201.62> from 10.8.0.30:57990
470
+ {bad_header,<<65,77,81,80,0,0,9,1>>}
471
+ </pre>
472
+
473
+ Means that client supports AMQP 0.9.1 but broker doesn't (RabbitMQ versions pre-2.0 only support AMQP 0.8, for example). If you are using amqp gem 0.8 or later
474
+ and seeing this entry in your broker log, you are connecting to AMQP broker that is too old to support this AMQP version. In case of RabbitMQ, make sure you run
475
+ version 2.0 or later.
476
+
477
+
478
+
349
479
  h2. What to read next
350
480
 
351
481
  * {file:docs/Queues.textile Queues}
@@ -265,7 +265,7 @@ account on Blabbr to get updates about what is up in the world of basketball. He
265
265
  require "rubygems"
266
266
  require "amqp"
267
267
 
268
- AMQP.start("amqp://dev.rabbitmq.com:5672/") do |connection|
268
+ AMQP.start("amqp://dev.rabbitmq.com:5672") do |connection|
269
269
  channel = AMQP::Channel.new(connection)
270
270
  exchange = channel.fanout("nba.scores")
271
271
 
@@ -568,7 +568,7 @@ This tutorial ends here. Congratulations! You have learned quite a bit about bot
568
568
 
569
569
  h2. What to read next
570
570
 
571
- Documentation is organized as a {file:docs/DocumentationGuidesIndex.textile Routing guide number of guides}, covering all kinds of
571
+ Documentation is organized as a {file:docs/DocumentationGuidesIndex.textile Number of guides}, covering all kinds of
572
572
  topics from {file:docs/Routing.textile routing} to {file:docs/ErrorHandling.textile error handling} to
573
573
  {file:docs/VendorSpecificExchanges.textile Broker-specific AMQP 0.9.1 extensions}.
574
574
 
@@ -59,7 +59,7 @@ Here is an example:
59
59
  <pre>
60
60
  <code>
61
61
  # Declaring a server-named queue using AMQP::Queue constructor
62
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
62
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
63
63
  AMQP::Channel.new do |channel, open_ok|
64
64
  AMQP::Queue.new(channel, "", :auto_delete => true) do |queue, declare_ok|
65
65
  puts "#{queue.name} is ready to go. AMQP method: #{declare_ok.inspect}"
@@ -78,7 +78,7 @@ If you want to declare a queue with a particular name, for example, "images.resi
78
78
  <pre>
79
79
  <code>
80
80
  # Declaring a server-named queue using AMQP::Queue constructor
81
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
81
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
82
82
  AMQP::Channel.new do |channel, open_ok|
83
83
  AMQP::Queue.new(channel, "images.resize", :auto_delete => true) do |queue, declare_ok|
84
84
  puts "#{queue.name} is ready to go."
@@ -153,7 +153,7 @@ require "rubygems"
153
153
  require "amqp"
154
154
 
155
155
  # Declaring a client-named queue using AMQP::Queue constructor
156
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
156
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
157
157
  AMQP::Channel.new do |channel, open_ok|
158
158
  AMQP::Queue.new(channel, "images.resize", :durable => true) do |queue, declare_ok|
159
159
  puts "#{queue.name} is ready to go."
@@ -178,7 +178,7 @@ require "rubygems"
178
178
  require "amqp"
179
179
 
180
180
  # Declaring a client-named queue using AMQP::Queue constructor
181
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
181
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
182
182
  AMQP::Channel.new do |channel, open_ok|
183
183
  channel.queue("images.resize", :durable => true) do |queue, declare_ok|
184
184
  puts "#{queue.name} is ready to go."
@@ -207,7 +207,7 @@ require "rubygems"
207
207
  require "amqp"
208
208
 
209
209
  # Declaring a server-named queue using AMQP::Queue constructor
210
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
210
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
211
211
  AMQP::Channel.new do |channel, open_ok|
212
212
  AMQP::Queue.new(channel, "", :auto_delete => true, :exclusive => true) do |queue, declare_ok|
213
213
  puts "#{queue.name} is ready to go."
@@ -232,7 +232,7 @@ require "rubygems"
232
232
  require "amqp"
233
233
 
234
234
  # Declaring a server-named queue using AMQP::Queue constructor
235
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
235
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
236
236
  AMQP::Channel.new do |channel, open_ok|
237
237
  channel.queue("", :auto_delete => true, :exclusive => true) do |queue, declare_ok|
238
238
  puts "#{queue.name} is ready to go."
@@ -262,7 +262,7 @@ require "rubygems"
262
262
  require "amqp"
263
263
 
264
264
  # Binding a queue to an exchange
265
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
265
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
266
266
  AMQP::Channel.new do |channel, open_ok|
267
267
  exchange = channel.fanout("amq.fanout")
268
268
 
@@ -289,7 +289,7 @@ require "rubygems"
289
289
  require "amqp"
290
290
 
291
291
  # Binding a queue to an exchange
292
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
292
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
293
293
  AMQP::Channel.new do |channel, open_ok|
294
294
  exchange_name = "amq.fanout"
295
295
 
@@ -322,7 +322,7 @@ Then when a message arrives, message header and body (aka payload) are passed to
322
322
  require "rubygems"
323
323
  require "amqp"
324
324
 
325
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
325
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
326
326
  AMQP::Channel.new do |channel, open_ok|
327
327
  exchange = channel.fanout("amq.fanout")
328
328
 
@@ -368,7 +368,7 @@ AMQP 0.9.1 also provides a way for applications to fetch (pull) messages from th
368
368
  require "rubygems"
369
369
  require "amqp"
370
370
 
371
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
371
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
372
372
  AMQP::Channel.new do |channel, open_ok|
373
373
  exchange = channel.fanout("amq.fanout")
374
374
 
@@ -409,7 +409,7 @@ Sometimes it is necessary to unsubscribe from messages without deleting a queue.
409
409
  require "rubygems"
410
410
  require "amqp"
411
411
 
412
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
412
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
413
413
  AMQP::Channel.new do |channel, open_ok|
414
414
  exchange = channel.fanout("amq.fanout")
415
415
 
@@ -449,7 +449,7 @@ To unbind queue from exchange, use {AMQP::Queue#unbind}:
449
449
  require "rubygems"
450
450
  require "amqp"
451
451
 
452
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
452
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
453
453
  puts "Connected"
454
454
  AMQP::Channel.new(connection) do |channel, open_ok|
455
455
  puts "Opened a channel"
@@ -493,7 +493,7 @@ It is possible to purge (remove all messages from) a queue using {AMQP::Queue#pu
493
493
  require "rubygems"
494
494
  require "amqp"
495
495
 
496
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
496
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
497
497
  puts "Connected"
498
498
  AMQP::Channel.new(connection) do |channel, open_ok|
499
499
  puts "Opened a channel"
@@ -533,7 +533,7 @@ To delete a queue, use {AMQP::Queue#delete}:
533
533
  require "rubygems"
534
534
  require "amqp"
535
535
 
536
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
536
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
537
537
  puts "Connected"
538
538
  AMQP::Channel.new(connection) do |channel, open_ok|
539
539
  puts "Opened a channel"
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require "bundler"
5
+ Bundler.setup
6
+
7
+ $:.unshift(File.expand_path("../../../lib", __FILE__))
8
+
9
+ require 'amqp'
10
+
11
+
12
+ puts "=> Channel#initialize example that uses a block"
13
+ puts
14
+ AMQP.start(:host => 'localhost') do |connection|
15
+ AMQP::Channel.new do |channel|
16
+ puts "Channel ##{channel.id} is now open!"
17
+ end
18
+
19
+
20
+ show_stopper = Proc.new do
21
+ $stdout.puts "Stopping..."
22
+
23
+ connection.close {
24
+ EM.stop { exit }
25
+ }
26
+ end
27
+
28
+ Signal.trap "INT", show_stopper
29
+ EM.add_timer(2, show_stopper)
30
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ require "bundler"
5
+ Bundler.setup
6
+
7
+ $:.unshift(File.expand_path("../../../lib", __FILE__))
8
+
9
+ require 'amqp'
10
+
11
+ # CODE BELOW IS USING DEPRECATED METHODS. PLEASE CONSIDER NOT USING THEM IF YOU CAN.
12
+ #
13
+ # The reason why these methods work at all is to make 0.6.x => 0.8.x migration easier so
14
+ # people won't be stuck with AMQP (the protocol) 0.8 forever and can benefit from more
15
+ # advanced AMQP 0.9.1 features.
16
+ #
17
+
18
+ EventMachine.run do
19
+ connection = AMQP.connect(:host => '127.0.0.1')
20
+ puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..."
21
+
22
+ queue = AMQP::Channel.queue("amqpgem.examples.hello_world", :auto_delete => true)
23
+ exchange = MQ.direct("")
24
+
25
+ queue.subscribe do |payload|
26
+ puts "Received a message: #{payload}. Disconnecting..."
27
+
28
+ connection.close {
29
+ EM.stop { exit }
30
+ }
31
+ end
32
+
33
+ exchange.publish "Hello, world!", :routing_key => queue.name
34
+ end
@@ -11,7 +11,7 @@ require 'amqp'
11
11
 
12
12
  puts "=> Queue redeclaration with different attributes results in a channel exception that is handled"
13
13
  puts
14
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
14
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
15
15
  AMQP::Channel.new do |channel, open_ok|
16
16
  puts "Channel ##{channel.id} is now open!"
17
17
 
@@ -11,7 +11,7 @@ require 'amqp'
11
11
 
12
12
  puts "=> Queue redeclaration with different attributes results in a channel exception that is handled"
13
13
  puts
14
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
14
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
15
15
  ch1 = AMQP::Channel.new(connection) do |ch, open_ok|
16
16
  puts "Channel ##{ch.id} is now open!"
17
17
  end
@@ -28,7 +28,7 @@ MSG
28
28
  puts
29
29
  puts
30
30
 
31
- AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672/") do |connection, open_ok|
31
+ AMQP.start("amqp://guest:guest@dev.rabbitmq.com:5672") do |connection, open_ok|
32
32
  AMQP::Channel.new do |channel, open_ok|
33
33
  puts "Channel ##{channel.id} is now open!"
34
34