amqp 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +10 -0
- data/examples/error_handling/automatically_recovering_hello_world_consumer.rb +1 -1
- data/examples/error_handling/automatically_recovering_hello_world_consumer_that_uses_a_server_named_queue.rb +1 -1
- data/lib/amqp/queue.rb +30 -55
- data/lib/amqp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 505c99ff4d142a7284d3b96a17efa6d284d1dcf0
|
4
|
+
data.tar.gz: c9c53b83f8a3aaac97723fdcb259da861843712a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c739321a577b28bebaac53a7ae8f62926247113195b3af9be44f44df2a97e5f43e3ec9ef55faa398726d18664d918fbef73c214d75799b93e91f686eb1b77943
|
7
|
+
data.tar.gz: af3a458405c5961af2d974e46148d0ef86e7d396b467bc0a74de6fbd19fbc684cf4e75853888a5d0c1c3af50ae0b7a8b479c53a73867b0dbe25789e34d5e284c
|
data/ChangeLog.md
CHANGED
@@ -12,7 +12,7 @@ puts "=> Example of automatic AMQP channel and queues recovery"
|
|
12
12
|
puts
|
13
13
|
AMQP.start(:host => ENV.fetch("BROKER_HOST", "localhost")) do |connection, open_ok|
|
14
14
|
connection.on_error do |ch, connection_close|
|
15
|
-
|
15
|
+
puts "[connection closed] #{connection_close.reply_text}"
|
16
16
|
end
|
17
17
|
|
18
18
|
ch1 = AMQP::Channel.new(connection, :auto_recovery => true)
|
@@ -12,7 +12,7 @@ puts "=> Example of automatic AMQP channel and queues recovery"
|
|
12
12
|
puts
|
13
13
|
AMQP.start(:host => "localhost") do |connection, open_ok|
|
14
14
|
connection.on_error do |ch, connection_close|
|
15
|
-
|
15
|
+
puts "[connection closed] #{connection_close.reply_text}"
|
16
16
|
end
|
17
17
|
|
18
18
|
ch1 = AMQP::Channel.new(connection, 2, :auto_recovery => true)
|
data/lib/amqp/queue.rb
CHANGED
@@ -354,43 +354,6 @@ module AMQP
|
|
354
354
|
end
|
355
355
|
|
356
356
|
|
357
|
-
# @group Error Handling and Recovery
|
358
|
-
|
359
|
-
# Used by automatic recovery machinery.
|
360
|
-
# @private
|
361
|
-
# @api plugin
|
362
|
-
def rebind(&block)
|
363
|
-
@bindings.each { |b| self.bind(b[:exchange], b) }
|
364
|
-
end
|
365
|
-
|
366
|
-
# Called by associated connection object when AMQP connection has been re-established
|
367
|
-
# (for example, after a network failure).
|
368
|
-
#
|
369
|
-
# @api plugin
|
370
|
-
def auto_recover
|
371
|
-
self.exec_callback_yielding_self(:before_recovery)
|
372
|
-
|
373
|
-
if self.server_named?
|
374
|
-
old_name = @name.dup
|
375
|
-
@name = AMQ::Protocol::EMPTY_STRING
|
376
|
-
|
377
|
-
@channel.queues.delete(old_name)
|
378
|
-
end
|
379
|
-
|
380
|
-
self.redeclare do
|
381
|
-
self.rebind
|
382
|
-
|
383
|
-
@consumers.each { |tag, consumer| consumer.auto_recover }
|
384
|
-
|
385
|
-
self.exec_callback_yielding_self(:after_recovery)
|
386
|
-
end
|
387
|
-
end # auto_recover
|
388
|
-
|
389
|
-
# @endgroup
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
357
|
# Remove the binding between the queue and exchange. The queue will
|
395
358
|
# not receive any more messages until it is bound to another
|
396
359
|
# exchange.
|
@@ -1223,9 +1186,38 @@ module AMQP
|
|
1223
1186
|
|
1224
1187
|
|
1225
1188
|
|
1226
|
-
|
1227
1189
|
# @group Error Handling & Recovery
|
1228
1190
|
|
1191
|
+
# Used by automatic recovery machinery.
|
1192
|
+
# @private
|
1193
|
+
# @api api
|
1194
|
+
def rebind(&block)
|
1195
|
+
@bindings.each { |b| self.bind(b[:exchange], b) }
|
1196
|
+
end
|
1197
|
+
|
1198
|
+
# Called by associated connection object when AMQP connection has been re-established
|
1199
|
+
# (for example, after a network failure).
|
1200
|
+
#
|
1201
|
+
# @api api
|
1202
|
+
def auto_recover
|
1203
|
+
self.exec_callback_yielding_self(:before_recovery)
|
1204
|
+
|
1205
|
+
if self.server_named?
|
1206
|
+
old_name = @name.dup
|
1207
|
+
@name = AMQ::Protocol::EMPTY_STRING
|
1208
|
+
|
1209
|
+
@channel.queues.delete(old_name)
|
1210
|
+
end
|
1211
|
+
|
1212
|
+
self.redeclare do
|
1213
|
+
self.rebind
|
1214
|
+
|
1215
|
+
@consumers.each { |tag, consumer| consumer.auto_recover }
|
1216
|
+
|
1217
|
+
self.exec_callback_yielding_self(:after_recovery)
|
1218
|
+
end
|
1219
|
+
end # auto_recover
|
1220
|
+
|
1229
1221
|
# Defines a callback that will be executed after TCP connection is interrupted (typically because of a network failure).
|
1230
1222
|
# Only one callback can be defined (the one defined last replaces previously added ones).
|
1231
1223
|
#
|
@@ -1268,23 +1260,6 @@ module AMQP
|
|
1268
1260
|
@consumers.each { |tag, c| c.run_after_recovery_callbacks }
|
1269
1261
|
end
|
1270
1262
|
|
1271
|
-
|
1272
|
-
|
1273
|
-
# Called by associated connection object when AMQP connection has been re-established
|
1274
|
-
# (for example, after a network failure).
|
1275
|
-
#
|
1276
|
-
# @api plugin
|
1277
|
-
def auto_recover
|
1278
|
-
self.exec_callback_yielding_self(:before_recovery)
|
1279
|
-
self.redeclare do
|
1280
|
-
self.rebind
|
1281
|
-
|
1282
|
-
@consumers.each { |tag, consumer| consumer.auto_recover }
|
1283
|
-
|
1284
|
-
self.exec_callback_yielding_self(:after_recovery)
|
1285
|
-
end
|
1286
|
-
end # auto_recover
|
1287
|
-
|
1288
1263
|
# @endgroup
|
1289
1264
|
|
1290
1265
|
|
data/lib/amqp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amqp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Gupta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: eventmachine
|