march_hare 2.4.0-java → 2.5.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82c92c56c3adf263af23af587c70d5ce91d3b171
4
- data.tar.gz: 0298791f0deeeab7b0c02b3594677f3041fb0114
3
+ metadata.gz: 73b8a86e921a22e112e007dbf65cedf99ac93bfc
4
+ data.tar.gz: 147ad313b6744b8b7b1a37991817221d7bdff723
5
5
  SHA512:
6
- metadata.gz: 7003b472edb275a6ab1e5251a5a70d87dbf1fe47fbeb644818c5b69a392ce1e7c7780798440f5a4e65b42d37792edc8af9fb0f2d0e657772f8900f8dc0ba78a4
7
- data.tar.gz: b6ad3b68c2efa9019828258cd78eb631699023bfa9dfe115b30f7792a8dd5cb1cce76243dcfdde6c43781116028db0673573991730038c1668c9dd4eab404b70
6
+ metadata.gz: 8720708bf788850d224c5bb46ef6376f2a18c04f82578e65ca32f5951eefa259e210fcb3b2b39c817415a76257d4d43394f5a75fa03ceceaf55d02d93984f4ad
7
+ data.tar.gz: 85d2c3825083117a09cd55d13ddd117c36e5d26b678250a229c58daa21808d326a9d95df62b54ea667495a2a969e5a324c2cebb0a2091bf4a44526dc8a56604f
@@ -268,7 +268,7 @@ module MarchHare
268
268
  def recover_consumers
269
269
  @consumers.values.each do |c|
270
270
  begin
271
- self.unregister_consumer(c)
271
+ self.unregister_consumer(c.consumer_tag)
272
272
  c.recover_from_network_failure
273
273
  rescue Exception => e
274
274
  # TODO: logger
@@ -89,7 +89,8 @@ module MarchHare
89
89
  class ChannelAlreadyClosed < Exception
90
90
  end
91
91
 
92
-
92
+ class ConnectionForced < Exception
93
+ end
93
94
 
94
95
  # Converts RabbitMQ Java client exceptions
95
96
  #
@@ -7,6 +7,11 @@ module MarchHare
7
7
  @consumer_tag = consumer_tag
8
8
  @envelope = envelope
9
9
  @properties = properties
10
+
11
+ # Prime the delivery tag when the instance is created. If #delivery_tag is first
12
+ # called after a recovery, then it'll fail to mismatch and will allow an invalid
13
+ # ack/nack, which will cause the channel to unexpectedly close
14
+ @delivery_tag = delivery_tag
10
15
  end
11
16
 
12
17
  def ack(options={})
@@ -197,13 +197,13 @@ module MarchHare
197
197
  # recovering immediately makes little sense. Wait a bit first. MK.
198
198
  java.lang.Thread.sleep(ms)
199
199
 
200
- @connection = converting_rjc_exceptions_to_ruby do
200
+ new_connection = converting_rjc_exceptions_to_ruby do
201
201
  reconnecting_on_network_failures(ms) do
202
202
  self.new_connection_impl
203
203
  end
204
204
  end
205
205
  @thread_pool = ThreadPools.dynamically_growing
206
- self.recover_shutdown_hooks
206
+ self.recover_shutdown_hooks(new_connection)
207
207
 
208
208
  # sorting channels by id means that the cases like the following:
209
209
  #
@@ -219,18 +219,20 @@ module MarchHare
219
219
  # in the order the user expects and before bindings.
220
220
  @channels.sort_by {|id, _| id}.each do |id, ch|
221
221
  begin
222
- ch.automatically_recover(self, @connection)
222
+ ch.automatically_recover(self, new_connection)
223
223
  rescue Exception, java.io.IOException => e
224
224
  # TODO: logging
225
225
  $stderr.puts e
226
226
  end
227
227
  end
228
+
229
+ @connection = new_connection
228
230
  end
229
231
 
230
232
  # @private
231
- def recover_shutdown_hooks
233
+ def recover_shutdown_hooks(connection)
232
234
  @shutdown_hooks.each do |sh|
233
- @connection.add_shutdown_listener(sh)
235
+ connection.add_shutdown_listener(sh)
234
236
  end
235
237
  end
236
238
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module MarchHare
4
- VERSION = "2.4.0"
4
+ VERSION = "2.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: march_hare
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: java
6
6
  authors:
7
7
  - Theo Hultberg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-09 00:00:00.000000000 Z
12
+ date: 2014-07-17 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: RabbitMQ client for JRuby built around the official RabbitMQ Java client
15
15
  email: