logstash-input-rabbitmq 3.1.1 → 3.1.2

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: a9811d797eb070d68e2463e7eba3e013592b5b7a
4
- data.tar.gz: 5b5596bd163c460fe4616783e0517e4715e75683
3
+ metadata.gz: 1569aff8f5c9ad1d47f104b671a63ccfe206d7f2
4
+ data.tar.gz: 6dd6f5cbe237df3c8c8a95480db9ea4d87d102a9
5
5
  SHA512:
6
- metadata.gz: 2d48171b808b11167286a324cb77acfb15738cc12ec2d28acb1b40ad1ea13c7c91feef3af53e54b56a5ebd12e7ac7f1a93e6033d84c29097b398f941f3e8d4cd
7
- data.tar.gz: c4a782a78990e84e692637c3c8c7f907f829f119c4ce5afdb5aa7732b4d85245873612d9b1aee0ec9e34530d033bc13facd92650ab965f4b09ad9719a4c4316b
6
+ metadata.gz: fb0304e6c8d3d6d2b76edd4c9e47433207264cd046041d705e1f0ad3691974acd53c64514e8ff07a25b31db6358ae3881b61314504b0f3c1da05c95cd5ca9e82
7
+ data.tar.gz: 77ef5d47aa3beb2f55e9206f4a054ebe8ceb021524f95a55ef1e14ab52e3a35f5bb70ef8879ce2e3f5faec783ba279e6b2af70035a5608fe88e3a943b74968ac
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ # 3.1.2
2
+ - Upgrade march hare version to fix file perms issue
1
3
  ## 3.1.1
2
4
  - Default codec setting should have been JSON
3
5
 
@@ -42,7 +42,7 @@ module LogStash
42
42
  # Passive queue creation? Useful for checking queue existance without modifying server state
43
43
  config :passive, :validate => :boolean, :default => false
44
44
 
45
- # The name of the exchange to bind the queue to
45
+ # The name of the exchange to bind the queue to.
46
46
  config :exchange, :validate => :string
47
47
 
48
48
  # The routing key to use when binding a queue to the exchange.
@@ -52,12 +52,18 @@ module LogStash
52
52
  # * Wildcards are not valid on direct exchanges.
53
53
  config :key, :validate => :string, :default => "logstash"
54
54
 
55
-
56
55
  def register
57
56
  connect!
58
57
  declare_queue!
59
58
  bind_exchange!
60
59
  @hare_info.channel.prefetch = @prefetch_count
60
+ rescue => e
61
+ @logger.warn("Error while setting up connection for rabbitmq input! Will retry.",
62
+ :message => e.message,
63
+ :class => e.class.name,
64
+ :location => e.backtrace.first)
65
+ sleep_for_retry
66
+ retry
61
67
  end
62
68
 
63
69
  def run(output_queue)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-rabbitmq'
3
- s.version = '3.1.1'
3
+ s.version = '3.1.2'
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/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", ">= 2.0.0.beta2", "< 3.0.0"
23
- s.add_runtime_dependency "logstash-mixin-rabbitmq_connection", '>= 2.2.0', '< 3.0.0'
23
+ s.add_runtime_dependency "logstash-mixin-rabbitmq_connection", '>= 2.3.0', '< 3.0.0'
24
24
 
25
25
  s.add_runtime_dependency 'logstash-codec-json'
26
26
 
@@ -30,6 +30,7 @@ describe LogStash::Inputs::RabbitMQ do
30
30
  let(:channel) { double("Channel") }
31
31
  let(:queue) { double("queue") }
32
32
 
33
+ # Doing this in a before block doesn't give us enough control over scope
33
34
  before do
34
35
  allow(instance).to receive(:connect!).and_call_original
35
36
  allow(::MarchHare).to receive(:connect).and_return(connection)
@@ -42,8 +43,7 @@ describe LogStash::Inputs::RabbitMQ do
42
43
 
43
44
  allow(queue).to receive(:build_consumer).with(:block => true)
44
45
  allow(queue).to receive(:subscribe_with).with(any_args)
45
-
46
- instance.register
46
+ allow(queue).to receive(:bind).with(any_args)
47
47
  end
48
48
 
49
49
  it "should default the codec to JSON" do
@@ -53,16 +53,44 @@ describe LogStash::Inputs::RabbitMQ do
53
53
  describe "#connect!" do
54
54
  subject { hare_info }
55
55
 
56
- it "should set the queue correctly" do
57
- expect(subject.queue).to eql(queue)
58
- end
56
+ context "without an exchange declared" do
57
+ before do
58
+ instance.register
59
+ end
60
+
61
+ it "should set the queue correctly" do
62
+ expect(subject.queue).to eql(queue)
63
+ end
59
64
 
60
- it "should set the prefetch value correctly" do
61
- expect(channel).to have_received(:prefetch=).with(123)
65
+ it "should set the prefetch value correctly" do
66
+ expect(channel).to have_received(:prefetch=).with(123)
67
+ end
62
68
  end
63
69
 
64
70
  context "with an exchange declared" do
65
- let(:instance) { rabbitmq_settings.merge("exchange" => "myexchange", "exchange_type" => "fanout") }
71
+ let(:exchange) { double("exchange") }
72
+ let(:key) { double("routing key") }
73
+ let(:rabbitmq_settings) { super.merge("exchange" => exchange, "key" => key) }
74
+
75
+ it "should bind to the exchange" do
76
+ instance.register
77
+ expect(queue).to have_received(:bind).with(exchange, :routing_key => key)
78
+ end
79
+
80
+ context "but not immediately available" do
81
+ before do
82
+ i = 0
83
+ allow(queue).to receive(:bind).with(any_args) do
84
+ i += 1
85
+ raise "foo" if i == 1
86
+ end
87
+ end
88
+
89
+ it "should reconnect" do
90
+ instance.register
91
+ expect(queue).to have_received(:bind).with(any_args).twice()
92
+ end
93
+ end
66
94
  end
67
95
  end
68
96
  end
metadata CHANGED
@@ -1,16 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-03 00:00:00.000000000 Z
11
+ date: 2015-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0.beta2
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: 3.0.0
14
23
  requirement: !ruby/object:Gem::Requirement
15
24
  requirements:
16
25
  - - '>='
@@ -19,79 +28,70 @@ dependencies:
19
28
  - - <
20
29
  - !ruby/object:Gem::Version
21
30
  version: 3.0.0
22
- name: logstash-core
23
31
  prerelease: false
24
32
  type: :runtime
33
+ - !ruby/object:Gem::Dependency
34
+ name: logstash-mixin-rabbitmq_connection
25
35
  version_requirements: !ruby/object:Gem::Requirement
26
36
  requirements:
27
37
  - - '>='
28
38
  - !ruby/object:Gem::Version
29
- version: 2.0.0.beta2
39
+ version: 2.3.0
30
40
  - - <
31
41
  - !ruby/object:Gem::Version
32
42
  version: 3.0.0
33
- - !ruby/object:Gem::Dependency
34
43
  requirement: !ruby/object:Gem::Requirement
35
44
  requirements:
36
45
  - - '>='
37
46
  - !ruby/object:Gem::Version
38
- version: 2.2.0
47
+ version: 2.3.0
39
48
  - - <
40
49
  - !ruby/object:Gem::Version
41
50
  version: 3.0.0
42
- name: logstash-mixin-rabbitmq_connection
43
51
  prerelease: false
44
52
  type: :runtime
53
+ - !ruby/object:Gem::Dependency
54
+ name: logstash-codec-json
45
55
  version_requirements: !ruby/object:Gem::Requirement
46
56
  requirements:
47
57
  - - '>='
48
58
  - !ruby/object:Gem::Version
49
- version: 2.2.0
50
- - - <
51
- - !ruby/object:Gem::Version
52
- version: 3.0.0
53
- - !ruby/object:Gem::Dependency
59
+ version: '0'
54
60
  requirement: !ruby/object:Gem::Requirement
55
61
  requirements:
56
62
  - - '>='
57
63
  - !ruby/object:Gem::Version
58
64
  version: '0'
59
- name: logstash-codec-json
60
65
  prerelease: false
61
66
  type: :runtime
67
+ - !ruby/object:Gem::Dependency
68
+ name: logstash-devutils
62
69
  version_requirements: !ruby/object:Gem::Requirement
63
70
  requirements:
64
71
  - - '>='
65
72
  - !ruby/object:Gem::Version
66
73
  version: '0'
67
- - !ruby/object:Gem::Dependency
68
74
  requirement: !ruby/object:Gem::Requirement
69
75
  requirements:
70
76
  - - '>='
71
77
  - !ruby/object:Gem::Version
72
78
  version: '0'
73
- name: logstash-devutils
74
79
  prerelease: false
75
80
  type: :development
81
+ - !ruby/object:Gem::Dependency
82
+ name: logstash-codec-plain
76
83
  version_requirements: !ruby/object:Gem::Requirement
77
84
  requirements:
78
85
  - - '>='
79
86
  - !ruby/object:Gem::Version
80
87
  version: '0'
81
- - !ruby/object:Gem::Dependency
82
88
  requirement: !ruby/object:Gem::Requirement
83
89
  requirements:
84
90
  - - '>='
85
91
  - !ruby/object:Gem::Version
86
92
  version: '0'
87
- name: logstash-codec-plain
88
93
  prerelease: false
89
94
  type: :development
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - '>='
93
- - !ruby/object:Gem::Version
94
- version: '0'
95
95
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
96
96
  email: info@elastic.co
97
97
  executables: []
@@ -135,4 +135,3 @@ specification_version: 4
135
135
  summary: Pull events from a RabbitMQ exchange.
136
136
  test_files:
137
137
  - spec/inputs/rabbitmq_spec.rb
138
- has_rdoc: