logstash-input-rabbitmq 5.1.1 → 5.2.0

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: fb907c268fdbcec47e813f94ea1b59f2bfcc79b2
4
- data.tar.gz: 2563a5a64b1b387a6f1fcebcc15f3bdfae4794c1
3
+ metadata.gz: 425af10298c6f798e8d62fc4191cc5eed01c2ccc
4
+ data.tar.gz: 3110a74f2ce80e6336dab525e28abf4283157367
5
5
  SHA512:
6
- metadata.gz: ec9c0534f7c5885d21a8400132531c0b70fecba815cefc8c882e9f28d5384a9ac9d978802c4f860433bb95e8f968783db3acb7a122b83336cf9a4c37aa06fc32
7
- data.tar.gz: 933e4647378eeb7557c1b3ea01e2b79ed8932c2faf2f505d92b0504ad146f19118c2b3e78c29b267a2b192fde24824ffc9cf318585c59d87471b77408f454ebc
6
+ metadata.gz: 2a301efb81cedfeead47c8a6c1e815f3b038398799a8017d6a22f6e219eaa20803f9766268e4e1d5a145f2b6c300a07d33b856a193284643825ba2cb5e251408
7
+ data.tar.gz: 79585a7e5224f00056678d762c89b50127e219734e156a4625515be7bfbd5dfe966ebc82678473f91887384555101603ded9cf1736c48d8e756dbe8a2dd24e5f
@@ -1,3 +1,8 @@
1
+ ## 5.2.0
2
+ - Fix behavior where plugin would block on register if server was unavailable
3
+ Plugin will now always exit register successfully and just log errors on #run
4
+ - Bumped connection mixin dependency to better handle proxies and error logging
5
+
1
6
  ## 5.1.1
2
7
  - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
3
8
 
@@ -171,7 +171,15 @@ module LogStash
171
171
 
172
172
  def register
173
173
  @internal_queue = java.util.concurrent.ArrayBlockingQueue.new(@prefetch_count*2)
174
+ end
175
+
176
+ def run(output_queue)
177
+ setup!
178
+ @output_queue = output_queue
179
+ consume!
180
+ end
174
181
 
182
+ def setup!
175
183
  connect!
176
184
  declare_queue!
177
185
  bind_exchange!
@@ -185,11 +193,6 @@ module LogStash
185
193
  retry
186
194
  end
187
195
 
188
- def run(output_queue)
189
- @output_queue = output_queue
190
- consume!
191
- end
192
-
193
196
  def bind_exchange!
194
197
  if @exchange
195
198
  if @exchange_type # Only declare the exchange if @exchange_type is set!
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-rabbitmq'
3
- s.version = '5.1.1'
3
+ s.version = '5.2.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Pull events from a RabbitMQ exchange."
6
6
  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"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # Gem dependencies
22
22
  s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
23
- s.add_runtime_dependency "logstash-mixin-rabbitmq_connection", '>= 4.1.1', '< 5.0.0'
23
+ s.add_runtime_dependency "logstash-mixin-rabbitmq_connection", '>= 4.2.0', '< 5.0.0'
24
24
 
25
25
  s.add_runtime_dependency 'logstash-codec-json'
26
26
 
@@ -36,13 +36,14 @@ describe LogStash::Inputs::RabbitMQ do
36
36
  allow(instance).to receive(:connect!).and_call_original
37
37
  allow(::MarchHare).to receive(:connect).and_return(connection)
38
38
  allow(connection).to receive(:create_channel).and_return(channel)
39
+ allow(connection).to receive(:on_shutdown)
39
40
  allow(connection).to receive(:on_blocked)
40
41
  allow(connection).to receive(:on_unblocked)
41
42
  allow(channel).to receive(:exchange).and_return(exchange)
42
43
  allow(channel).to receive(:queue).and_return(queue)
43
44
  allow(channel).to receive(:prefetch=)
44
45
 
45
- allow(queue).to receive(:build_consumer).with(:block => true)
46
+ allow(queue).to receive(:build_consumer).with(:on_cancellation => anything)
46
47
  allow(queue).to receive(:subscribe_with).with(any_args)
47
48
  allow(queue).to receive(:bind).with(any_args)
48
49
  end
@@ -57,6 +58,7 @@ describe LogStash::Inputs::RabbitMQ do
57
58
  context "without an exchange declared" do
58
59
  before do
59
60
  instance.register
61
+ instance.setup!
60
62
  end
61
63
 
62
64
  it "should set the queue correctly" do
@@ -77,9 +79,10 @@ describe LogStash::Inputs::RabbitMQ do
77
79
  allow(instance).to receive(:declare_exchange!)
78
80
  end
79
81
 
80
- context "on register" do
82
+ context "on run" do
81
83
  before do
82
84
  instance.register
85
+ instance.setup!
83
86
  end
84
87
 
85
88
  it "should bind to the exchange" do
@@ -102,6 +105,7 @@ describe LogStash::Inputs::RabbitMQ do
102
105
 
103
106
  it "should reconnect" do
104
107
  instance.register
108
+ instance.setup!
105
109
  expect(queue).to have_received(:bind).with(any_args).twice()
106
110
  end
107
111
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -35,7 +35,7 @@ dependencies:
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 4.1.1
38
+ version: 4.2.0
39
39
  - - "<"
40
40
  - !ruby/object:Gem::Version
41
41
  version: 5.0.0
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 4.1.1
49
+ version: 4.2.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 5.0.0
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.6.3
132
+ rubygems_version: 2.4.8
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Pull events from a RabbitMQ exchange.