march_hare 2.22.0-java → 3.0.0-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a889247b3117153a7ad84bd1ec2e4782e3d6a2ee
4
- data.tar.gz: 9351d6dc9dfeae13a3d69c7cf0cfa4db2e83d4b8
3
+ metadata.gz: 24c5f476a2e6d0f317060d847bac5b3415a6af9e
4
+ data.tar.gz: cbd1a71d51155ca8898b89983c3409b08a914378
5
5
  SHA512:
6
- metadata.gz: b0adce10eeff54a014a666f1df771ab98488515cd3c8b723cae40004db9e937de6df1a11c3665953e73df01542a50e388308f1ba0ba36dfc4461c26931740603
7
- data.tar.gz: e0ab94b741fb34fc7ce7a676a0befeabb18acc88120547105ad151e17db783db1221a2bb9879d17829dad427d55b5de3a69e35b90a34af671082846bcf08c738
6
+ metadata.gz: 26dcc481444be82948f0234e493ab7c943e4f292e5f455e53acf1a1405b622846bf734d8f6bae3f10e06951b96ba760667fcc1a3e614484328fad7b61d486e87
7
+ data.tar.gz: 69586d383dacb082c63221b51fed78795d94d31377b77cf296cfd5a46b8ed348d39373916d75c617a70c450df09df87434f247396e842311abc61babc6c13089
Binary file
Binary file
Binary file
@@ -1,7 +1,11 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  require 'java'
4
- require 'ext/commons-io'
4
+
5
+ # Java client logging depends on SLF4J
6
+ require 'ext/slf4j-api'
7
+ require 'ext/slf4j-simple'
8
+
5
9
  require 'ext/rabbitmq-client'
6
10
 
7
11
  require 'march_hare/version'
@@ -985,7 +985,7 @@ module MarchHare
985
985
  def guarding_against_stale_delivery_tags(tag, &block)
986
986
  case tag
987
987
  # if a fixnum was passed, execute unconditionally. MK.
988
- when Fixnum then
988
+ when Integer then
989
989
  block.call
990
990
  # versioned delivery tags should be checked to avoid
991
991
  # sending out stale (invalid) tags after channel was reopened
@@ -9,6 +9,7 @@ module MarchHare
9
9
  java_import com.rabbitmq.client.Connection
10
10
  java_import com.rabbitmq.client.BlockedListener
11
11
  java_import com.rabbitmq.client.NullTrustManager
12
+ java_import com.rabbitmq.client.MissedHeartbeatException
12
13
 
13
14
  java_import javax.net.ssl.SSLContext
14
15
  java_import javax.net.ssl.KeyManagerFactory
@@ -121,6 +122,13 @@ module MarchHare
121
122
  # @private
122
123
  def initialize(connection_factory, opts = {})
123
124
  @cf = connection_factory
125
+
126
+ # March Hare uses its own connection recovery implementation and
127
+ # as of Java client 4.x automatic recovery is enabled by
128
+ # default. MK.
129
+ @cf.automatic_recovery_enabled = false
130
+ @cf.topology_recovery_enabled = false
131
+
124
132
  @uri = opts[:uri]
125
133
  @uses_uri = !(@uri.nil?)
126
134
  # executors cannot be restarted after shutdown,
@@ -239,7 +247,7 @@ module MarchHare
239
247
  # @private
240
248
  def add_automatic_recovery_hook
241
249
  fn = Proc.new do |_, signal|
242
- if !signal.initiated_by_application
250
+ if should_initiate_connection_recovery?(signal)
243
251
  self.automatically_recover
244
252
  end
245
253
  end
@@ -247,6 +255,11 @@ module MarchHare
247
255
  @automatic_recovery_hook = self.on_shutdown(&fn)
248
256
  end
249
257
 
258
+ # @private
259
+ def should_initiate_connection_recovery?(signal)
260
+ !signal.initiated_by_application || signal.instance_of?(MissedHeartbeatException)
261
+ end
262
+
250
263
  # @private
251
264
  def disable_automatic_recovery
252
265
  @connection.remove_shutdown_listener(@automatic_recovery_hook) if @automatic_recovery_hook
@@ -321,6 +334,7 @@ module MarchHare
321
334
  #
322
335
  # So we stub out #start in case someone migrating from Bunny forgets to remove
323
336
  # the call to #start. MK.
337
+ self
324
338
  end
325
339
 
326
340
  def username
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module MarchHare
4
- VERSION = "2.22.0"
4
+ VERSION = "3.0.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.22.0
4
+ version: 3.0.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: 2017-01-14 00:00:00.000000000 Z
12
+ date: 2017-02-20 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:
@@ -19,8 +19,9 @@ executables: []
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
- - lib/ext/commons-io.jar
23
22
  - lib/ext/rabbitmq-client.jar
23
+ - lib/ext/slf4j-api.jar
24
+ - lib/ext/slf4j-simple.jar
24
25
  - lib/march_hare.rb
25
26
  - lib/march_hare/channel.rb
26
27
  - lib/march_hare/consumers.rb
Binary file