logstash-input-rabbitmq 3.0.3 → 3.1.1

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: a23bf561fdadde23689518cee2bec4774f80dbbc
4
- data.tar.gz: 8d4de91afa94ee7c8ed801cbed5bfb752ab7b0d5
3
+ metadata.gz: a9811d797eb070d68e2463e7eba3e013592b5b7a
4
+ data.tar.gz: 5b5596bd163c460fe4616783e0517e4715e75683
5
5
  SHA512:
6
- metadata.gz: 4abe5ece04367dc9f8aadded9f32ec7d495fd3131945cb4e9aa54a862227af22762f07dea20510561cb3345bd2c2ba74520281979363a832e3e21ac32827add9
7
- data.tar.gz: afb4839da1b5f33ce161d5ddb738dcc681b72557fd033a57524f26e7470c6200def8b2e3610f82b0ecbfd9d2a84e939c7df0a0b99723f94d551bf97b75be420b
6
+ metadata.gz: 2d48171b808b11167286a324cb77acfb15738cc12ec2d28acb1b40ad1ea13c7c91feef3af53e54b56a5ebd12e7ac7f1a93e6033d84c29097b398f941f3e8d4cd
7
+ data.tar.gz: c4a782a78990e84e692637c3c8c7f907f829f119c4ce5afdb5aa7732b4d85245873612d9b1aee0ec9e34530d033bc13facd92650ab965f4b09ad9719a4c4316b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.1.1
2
+ - Default codec setting should have been JSON
3
+
4
+ ## 3.1.0
5
+ - Fix broken prefetch count parameter
6
+
1
7
  ## 3.0.2
2
8
  - Bump dependency on logstash-mixin-rabbitmq_connection
3
9
 
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Logstash Plugin
2
2
 
3
+ [![Build
4
+ Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-rabbitmq-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-rabbitmq-unit/)
5
+
3
6
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
7
 
5
8
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
@@ -7,7 +7,10 @@ module LogStash
7
7
  class RabbitMQ < LogStash::Inputs::Threadable
8
8
  include ::LogStash::PluginMixins::RabbitMQConnection
9
9
 
10
- config_name("rabbitmq")
10
+ config_name "rabbitmq"
11
+
12
+ # The default codec for this plugin is JSON. You can override this to suit your particular needs however.
13
+ default :codec, "json"
11
14
 
12
15
  # The name of the queue Logstash will consume events from.
13
16
  config :queue, :validate => :string, :default => ""
@@ -52,9 +55,9 @@ module LogStash
52
55
 
53
56
  def register
54
57
  connect!
55
-
56
58
  declare_queue!
57
59
  bind_exchange!
60
+ @hare_info.channel.prefetch = @prefetch_count
58
61
  end
59
62
 
60
63
  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.0.3'
3
+ s.version = '3.1.1'
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.0.1', '< 3.0.0'
23
+ s.add_runtime_dependency "logstash-mixin-rabbitmq_connection", '>= 2.2.0', '< 3.0.0'
24
24
 
25
25
  s.add_runtime_dependency 'logstash-codec-json'
26
26
 
@@ -16,7 +16,8 @@ describe LogStash::Inputs::RabbitMQ do
16
16
  {
17
17
  "host" => host,
18
18
  "port" => port,
19
- "queue" => queue
19
+ "queue" => queue,
20
+ "prefetch_count" => 123
20
21
  }
21
22
  }
22
23
  let(:instance) { klass.new(rabbitmq_settings) }
@@ -37,6 +38,7 @@ describe LogStash::Inputs::RabbitMQ do
37
38
  allow(connection).to receive(:on_unblocked)
38
39
  allow(channel).to receive(:exchange).and_return(exchange)
39
40
  allow(channel).to receive(:queue).and_return(queue)
41
+ allow(channel).to receive(:prefetch=)
40
42
 
41
43
  allow(queue).to receive(:build_consumer).with(:block => true)
42
44
  allow(queue).to receive(:subscribe_with).with(any_args)
@@ -44,6 +46,10 @@ describe LogStash::Inputs::RabbitMQ do
44
46
  instance.register
45
47
  end
46
48
 
49
+ it "should default the codec to JSON" do
50
+ expect(instance.codec).to be_a(LogStash::Codecs::JSON)
51
+ end
52
+
47
53
  describe "#connect!" do
48
54
  subject { hare_info }
49
55
 
@@ -51,6 +57,10 @@ describe LogStash::Inputs::RabbitMQ do
51
57
  expect(subject.queue).to eql(queue)
52
58
  end
53
59
 
60
+ it "should set the prefetch value correctly" do
61
+ expect(channel).to have_received(:prefetch=).with(123)
62
+ end
63
+
54
64
  context "with an exchange declared" do
55
65
  let(:instance) { rabbitmq_settings.merge("exchange" => "myexchange", "exchange_type" => "fanout") }
56
66
  end
@@ -109,6 +119,10 @@ describe "with a live server", :integration => true do
109
119
  end
110
120
  end
111
121
 
122
+ it "should have the correct prefetch value" do
123
+ expect(instance.instance_variable_get(:@hare_info).channel.prefetch).to eql(256)
124
+ end
125
+
112
126
  describe "receiving a message with a queue specified" do
113
127
  let(:queue_name) { "foo_queue" }
114
128
  let(:config) { super.merge("queue" => queue_name) }
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: 3.0.3
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-11-03 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: 2.0.1
38
+ version: 2.2.0
39
39
  - - <
40
40
  - !ruby/object:Gem::Version
41
41
  version: 3.0.0
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - '>='
48
48
  - !ruby/object:Gem::Version
49
- version: 2.0.1
49
+ version: 2.2.0
50
50
  - - <
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.0.0
@@ -135,3 +135,4 @@ 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: