logstash-mixin-rabbitmq_connection 4.1.3-java → 4.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d69c8668720b7ebda212adced29bc3d12e49f574
|
4
|
+
data.tar.gz: 132c42eb041488be8e104ed56eb1768c95129b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc00581244fe0d5be9fd812d02ba202169fa90da128d2e70a4648994cfd55a74b13e2075e89fa2e2968f84a012925ffff7a01b37ccf1cc5dd926337c104fff6a
|
7
|
+
data.tar.gz: 15328dfa0dfbbc23fd7e6a0aa062abd2cd61bbd6c59a00e2e279fa8a66df42aceeb57b624ce8aed17b939435d5dcc421728e741e625bd94278186d26eacc10c8
|
data/CHANGELOG
CHANGED
@@ -18,7 +18,7 @@ module LogStash
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def setup_rabbitmq_connection_config
|
21
|
-
# RabbitMQ server address(es)
|
21
|
+
# RabbitMQ server address(es)
|
22
22
|
# host can either be a single host, or a list of hosts
|
23
23
|
# i.e.
|
24
24
|
# host => "localhost"
|
@@ -201,9 +201,19 @@ module LogStash
|
|
201
201
|
|
202
202
|
connection = MarchHare.connect(rabbitmq_settings)
|
203
203
|
|
204
|
-
|
205
|
-
|
206
|
-
|
204
|
+
connection.on_shutdown do |conn, cause|
|
205
|
+
@logger.warn("RabbitMQ connection was closed!",
|
206
|
+
:url => connection_url(conn),
|
207
|
+
:automatic_recovery => @automatic_recovery,
|
208
|
+
:cause => cause)
|
209
|
+
end
|
210
|
+
connection.on_blocked do
|
211
|
+
@logger.warn("RabbitMQ connection blocked! Check your RabbitMQ instance!",
|
212
|
+
:url => connection_url(connection))
|
213
|
+
end
|
214
|
+
connection.on_unblocked do
|
215
|
+
@logger.warn("RabbitMQ connection unblocked!", :url => connection_url(connection))
|
216
|
+
end
|
207
217
|
|
208
218
|
channel = connection.create_channel
|
209
219
|
@logger.info("Connected to RabbitMQ at #{rabbitmq_settings[:host]}")
|
@@ -211,6 +221,13 @@ module LogStash
|
|
211
221
|
HareInfo.new(connection, channel)
|
212
222
|
end
|
213
223
|
|
224
|
+
# Mostly used for printing debug logs
|
225
|
+
def connection_url(connection)
|
226
|
+
user_pass = connection.user ? "#{connection.user}:XXXXXX@" : ""
|
227
|
+
protocol = params["ssl"] ? "amqps" : "amqp"
|
228
|
+
"#{protocol}://#{user_pass}#{connection.host}:#{connection.port}#{connection.vhost}"
|
229
|
+
end
|
230
|
+
|
214
231
|
def sleep_for_retry
|
215
232
|
Stud.stoppable_sleep(@connect_retry_interval) { @rabbitmq_connection_stopping }
|
216
233
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'logstash-mixin-rabbitmq_connection'
|
4
|
-
s.version = '4.
|
4
|
+
s.version = '4.2.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Common functionality for RabbitMQ plugins"
|
7
7
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
@@ -96,6 +96,7 @@ describe LogStash::PluginMixins::RabbitMQConnection do
|
|
96
96
|
allow(connection).to receive(:create_channel).and_return(channel)
|
97
97
|
allow(connection).to receive(:on_blocked)
|
98
98
|
allow(connection).to receive(:on_unblocked)
|
99
|
+
allow(connection).to receive(:on_shutdown)
|
99
100
|
|
100
101
|
instance.register
|
101
102
|
end
|