march_hare 4.1.0-java → 4.4.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ext/rabbitmq-client.jar +0 -0
- data/lib/ext/slf4j-api.jar +0 -0
- data/lib/ext/slf4j-simple.jar +0 -0
- data/lib/march_hare/exceptions.rb +6 -0
- data/lib/march_hare/metadata.rb +1 -1
- data/lib/march_hare/session.rb +15 -3
- data/lib/march_hare/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3515365e0557a86fbd8e420d7fdbe43aa18c063fc34d86d94f5af449d0f1fa0c
|
4
|
+
data.tar.gz: da9a5a017bfcff8f29452a33cba121ff7dea8a9c0db2fa1eb56bd5fbe9f94e8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df022f62afcef6c1aec7e8355fe1eb2e7b891d4efb51bd644fc5fafff2633e1cf21d8a7b08924baf04874c20e1bae9c43a393e0d0c2f3f1656bca8b649673f8
|
7
|
+
data.tar.gz: d8bb0b7c50e50c1ea78a23ae652c66c424f073785c95573b1f365ec11ea84959ea607cb7e9eee1394a66a5702d32ad6b8d2f5ddb90242316d847bfa2e1d00aa6
|
data/lib/ext/rabbitmq-client.jar
CHANGED
Binary file
|
data/lib/ext/slf4j-api.jar
CHANGED
Binary file
|
data/lib/ext/slf4j-simple.jar
CHANGED
Binary file
|
@@ -16,6 +16,12 @@ module MarchHare
|
|
16
16
|
class ConnectionRefused < NetworkException
|
17
17
|
end
|
18
18
|
|
19
|
+
class ConnectionClosedException < Exception
|
20
|
+
def initialize(message='')
|
21
|
+
super("Connection was explicitly closed and cannot be reopened. Create a new Connection instead. #{message}")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
19
25
|
class ChannelLevelException < Exception
|
20
26
|
attr_reader :channel_close
|
21
27
|
|
data/lib/march_hare/metadata.rb
CHANGED
data/lib/march_hare/session.rb
CHANGED
@@ -88,7 +88,7 @@ module MarchHare
|
|
88
88
|
when true then
|
89
89
|
cf.use_ssl_protocol
|
90
90
|
when String then
|
91
|
-
|
91
|
+
options[:logger].info("Using TLS/SSL version #{tls}") if options[:logger]
|
92
92
|
# Note: `options[:trust_manager] = com.rabbitmq.client.TrustEverythingTrustManager.new`
|
93
93
|
# can be set to effectively disable TLS verification.
|
94
94
|
if (cert_path = tls_certificate_path_from(options)) && (password = tls_certificate_password_from(options))
|
@@ -103,7 +103,7 @@ module MarchHare
|
|
103
103
|
kmf.init(ks, pwd)
|
104
104
|
|
105
105
|
if options[:trust_manager]
|
106
|
-
ctx.init(kmf.get_key_managers,
|
106
|
+
ctx.init(kmf.get_key_managers, Array(options[:trust_manager]), nil)
|
107
107
|
else
|
108
108
|
# use the key store as the trust store
|
109
109
|
tmf = TrustManagerFactory.get_instance(TrustManagerFactory.getDefaultAlgorithm());
|
@@ -111,6 +111,7 @@ module MarchHare
|
|
111
111
|
ctx.init(kmf.get_key_managers, tmf.getTrustManagers(), nil)
|
112
112
|
end
|
113
113
|
|
114
|
+
cf.set_sasl_config(options[:sasl_config]) if options[:sasl_config]
|
114
115
|
cf.use_ssl_protocol(ctx)
|
115
116
|
rescue Java::JavaLang::Throwable => e
|
116
117
|
message = e.message
|
@@ -179,6 +180,7 @@ module MarchHare
|
|
179
180
|
@shutdown_hooks = Array.new
|
180
181
|
@blocked_connection_hooks = Array.new
|
181
182
|
@connection_recovery_hooks = Array.new
|
183
|
+
@was_explicitly_closed = false
|
182
184
|
|
183
185
|
if @automatically_recover
|
184
186
|
self.add_automatic_recovery_hook
|
@@ -224,8 +226,16 @@ module MarchHare
|
|
224
226
|
ch.close
|
225
227
|
end
|
226
228
|
|
229
|
+
@was_explicitly_closed = true
|
227
230
|
maybe_shut_down_executor
|
228
231
|
@connection.close
|
232
|
+
rescue com.rabbitmq.client.AlreadyClosedException
|
233
|
+
@logger.debug("close: connection already closed")
|
234
|
+
end
|
235
|
+
|
236
|
+
def reopen
|
237
|
+
@was_explicitly_closed = false
|
238
|
+
automatically_recover
|
229
239
|
end
|
230
240
|
|
231
241
|
# @return [Boolean] true if connection is open, false otherwise
|
@@ -317,7 +327,8 @@ module MarchHare
|
|
317
327
|
# Begins automatic connection recovery (typically only used internally
|
318
328
|
# to recover from network failures)
|
319
329
|
def automatically_recover
|
320
|
-
|
330
|
+
raise ConnectionClosedException if @was_explicitly_closed
|
331
|
+
@logger.debug("session: begin automatic connection recovery #{Thread.current.inspect}")
|
321
332
|
|
322
333
|
fire_recovery_start_hooks
|
323
334
|
|
@@ -582,6 +593,7 @@ module MarchHare
|
|
582
593
|
def reconnecting_on_network_failures(interval_in_ms, &fn)
|
583
594
|
@logger.debug("session: reconnecting_on_network_failures")
|
584
595
|
begin
|
596
|
+
return if @was_explicitly_closed
|
585
597
|
fn.call
|
586
598
|
rescue IOError, MarchHare::ConnectionRefused, java.io.IOException, java.util.concurrent.TimeoutException
|
587
599
|
java.lang.Thread.sleep(interval_in_ms)
|
data/lib/march_hare/version.rb
CHANGED
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: 4.
|
4
|
+
version: 4.4.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:
|
12
|
+
date: 2021-10-08 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:
|
@@ -56,7 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
|
59
|
+
rubyforge_project: march_hare
|
60
|
+
rubygems_version: 2.7.10
|
60
61
|
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: RabbitMQ client for JRuby built around the official RabbitMQ Java client
|