logstash-mixin-rabbitmq_connection 2.0.2-java → 2.1.1-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: 708cbc1a1b93eb361ca3171cf52bb4b8ffc96b60
4
- data.tar.gz: fd69d3314486d68c844a99c5fc09f24211001674
3
+ metadata.gz: 8dcab8d78a4949e57c440fcef4d467a988850c38
4
+ data.tar.gz: d8ae8f4162be1ab1b209bc7691c5e80c80b10e8e
5
5
  SHA512:
6
- metadata.gz: bd02b93acea04a314039bc458ce3d8f0e04f676ecc3fb03fc06124590adca48d8733679cb53966a8496c9866c78bd8d57bf1fe8c7f766afc7756ac3bc26a8141
7
- data.tar.gz: eb945382e7bdf2b822c5ff319ad6601eca31511a97a72c04bf1a7594ffc43098078eebd56611a4d3f004677babe390af75efe364ce45a9d96d8de4b06fb50a78
6
+ metadata.gz: eecfa540f15d9035b3ee1d06af65385b2fba199236fe282619bada989e4fce502365d41f1b0008597426c3b6256fbcf7ddc39614caba8447b716ae9bcbeb3cf2
7
+ data.tar.gz: 9080f84ca00d661e2e8e9e1af104fe0ab8cbc781cbccf9ff29663fd2e2428c985b61e1ae504e7e5b89bf1ea2ab6b929420adb0c932ec00a14ee0990c871072d6
data/CHANGELOG ADDED
@@ -0,0 +1,11 @@
1
+ * 2.1.1
2
+ - Make rake vendor run, for jarvis
3
+ * 2.1.0
4
+ - Add prefetch_count config option
5
+ * 2.0.3
6
+ - Add heartbeat setting
7
+ - Add connect_timeout setting
8
+ * 2.0.0
9
+ - Make LS2 compatible
10
+ * 1.0.1
11
+ - Initial Release
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rake"
@@ -48,9 +48,18 @@ module LogStash
48
48
  # Time in seconds to wait before retrying a connection
49
49
  config :connect_retry_interval, :validate => :number, :default => 1
50
50
 
51
+ # The default connection timeout in milliseconds. If not specified the timeout is infinite.
52
+ config :connection_timeout, :validate => :number
53
+
54
+ # Heartbeat delay in seconds. If unspecified no heartbeats will be sent
55
+ config :heartbeat, :validate => :number
56
+
51
57
  # Passive queue creation? Useful for checking queue existance without modifying server state
52
58
  config :passive, :validate => :boolean, :default => false
53
59
 
60
+ # Prefetch count. Number of messages to prefetch
61
+ config :prefetch_count, :validate => :number, :default => 256
62
+
54
63
  # Extra queue arguments as an array.
55
64
  # To make a RabbitMQ queue mirrored, use: `{"x-ha-policy" => "all"}`
56
65
  config :arguments, :validate => :array, :default => {}
@@ -77,6 +86,9 @@ module LogStash
77
86
  :automatic_recovery => @automatic_recovery,
78
87
  :pass => @password ? @password.value : "guest",
79
88
  }
89
+
90
+ s[:timeout] = @connection_timeout || 0
91
+ s[:heartbeat] = @heartbeat || 0
80
92
  s[:tls] = @ssl if @ssl
81
93
  @rabbitmq_settings = s
82
94
  end
@@ -130,6 +142,8 @@ module LogStash
130
142
  connection.on_unblocked { @logger.warn("RabbitMQ output unblocked!") }
131
143
 
132
144
  channel = connection.create_channel
145
+ channel.prefetch = prefetch_count
146
+
133
147
  @logger.info("Connected to RabbitMQ at #{rabbitmq_settings[:host]}")
134
148
 
135
149
  HareInfo.new(connection, channel)
@@ -140,4 +154,4 @@ module LogStash
140
154
  end
141
155
  end
142
156
  end
143
- end
157
+ end
@@ -1,7 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
-
3
2
  s.name = 'logstash-mixin-rabbitmq_connection'
4
- s.version = '2.0.2'
3
+ s.version = '2.1.1'
5
4
  s.licenses = ['Apache License (2.0)']
6
5
  s.summary = "Common functionality for RabbitMQ plugins"
7
6
  s.description = "This is used to provide configuration options and connection settings for logstash plugins working with RabbitMQ"
@@ -26,6 +26,18 @@ describe LogStash::PluginMixins::RabbitMQConnection do
26
26
  }
27
27
  let(:hare_info) { instance.instance_variable_get(:@hare_info) }
28
28
 
29
+ describe "rabbitmq_settings" do
30
+ let(:rabbitmq_settings) { super.merge({"connection_timeout" => 123, "heartbeat" => 456}) }
31
+
32
+ it "should set the timeout to the expected value" do
33
+ expect(instance.rabbitmq_settings[:timeout]).to eql(rabbitmq_settings["connection_timeout"])
34
+ end
35
+
36
+ it "should set heartbeat to the expected value" do
37
+ expect(instance.rabbitmq_settings[:heartbeat]).to eql(rabbitmq_settings["heartbeat"])
38
+ end
39
+ end
40
+
29
41
  context "when connected" do
30
42
  let(:connection) { double("MarchHare Connection") }
31
43
  let(:channel) { double("Channel") }
@@ -36,6 +48,7 @@ describe LogStash::PluginMixins::RabbitMQConnection do
36
48
  allow(connection).to receive(:create_channel).and_return(channel)
37
49
  allow(connection).to receive(:on_blocked)
38
50
  allow(connection).to receive(:on_unblocked)
51
+ allow(channel).to receive(:prefetch=).with(kind_of(Numeric))
39
52
 
40
53
  instance.register
41
54
  end
@@ -66,6 +79,10 @@ describe LogStash::PluginMixins::RabbitMQConnection do
66
79
  it "should set the channel correctly" do
67
80
  expect(subject.channel).to eql(channel)
68
81
  end
82
+
83
+ it "should set prefetch correctly" do
84
+ expect(subject.channel.prefetch=50).to eql(50)
85
+ end
69
86
  end
70
87
  end
71
88
 
@@ -100,4 +117,4 @@ describe LogStash::PluginMixins::RabbitMQConnection do
100
117
  expect(subject).to have_received(:sleep_for_retry).once
101
118
  end
102
119
  end
103
- end
120
+ end
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-mixin-rabbitmq_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.1
5
5
  platform: java
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-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: logstash-core
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - '>='
17
18
  - !ruby/object:Gem::Version
@@ -19,10 +20,7 @@ dependencies:
19
20
  - - <
20
21
  - !ruby/object:Gem::Version
21
22
  version: 3.0.0
22
- name: logstash-core
23
- prerelease: false
24
- type: :runtime
25
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - '>='
28
26
  - !ruby/object:Gem::Version
@@ -30,76 +28,78 @@ dependencies:
30
28
  - - <
31
29
  - !ruby/object:Gem::Version
32
30
  version: 3.0.0
31
+ prerelease: false
32
+ type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
+ name: march_hare
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: 2.11.0
34
40
  requirement: !ruby/object:Gem::Requirement
35
41
  requirements:
36
42
  - - ~>
37
43
  - !ruby/object:Gem::Version
38
44
  version: 2.11.0
39
- name: march_hare
40
45
  prerelease: false
41
46
  type: :runtime
47
+ - !ruby/object:Gem::Dependency
48
+ name: stud
42
49
  version_requirements: !ruby/object:Gem::Requirement
43
50
  requirements:
44
51
  - - ~>
45
52
  - !ruby/object:Gem::Version
46
- version: 2.11.0
47
- - !ruby/object:Gem::Dependency
53
+ version: 0.0.22
48
54
  requirement: !ruby/object:Gem::Requirement
49
55
  requirements:
50
56
  - - ~>
51
57
  - !ruby/object:Gem::Version
52
58
  version: 0.0.22
53
- name: stud
54
59
  prerelease: false
55
60
  type: :runtime
61
+ - !ruby/object:Gem::Dependency
62
+ name: logstash-devutils
56
63
  version_requirements: !ruby/object:Gem::Requirement
57
64
  requirements:
58
- - - ~>
65
+ - - '>='
59
66
  - !ruby/object:Gem::Version
60
- version: 0.0.22
61
- - !ruby/object:Gem::Dependency
67
+ version: '0'
62
68
  requirement: !ruby/object:Gem::Requirement
63
69
  requirements:
64
70
  - - '>='
65
71
  - !ruby/object:Gem::Version
66
72
  version: '0'
67
- name: logstash-devutils
68
73
  prerelease: false
69
74
  type: :development
75
+ - !ruby/object:Gem::Dependency
76
+ name: logstash-input-generator
70
77
  version_requirements: !ruby/object:Gem::Requirement
71
78
  requirements:
72
79
  - - '>='
73
80
  - !ruby/object:Gem::Version
74
81
  version: '0'
75
- - !ruby/object:Gem::Dependency
76
82
  requirement: !ruby/object:Gem::Requirement
77
83
  requirements:
78
84
  - - '>='
79
85
  - !ruby/object:Gem::Version
80
86
  version: '0'
81
- name: logstash-input-generator
82
87
  prerelease: false
83
88
  type: :development
89
+ - !ruby/object:Gem::Dependency
90
+ name: logstash-codec-json
84
91
  version_requirements: !ruby/object:Gem::Requirement
85
92
  requirements:
86
93
  - - '>='
87
94
  - !ruby/object:Gem::Version
88
95
  version: '0'
89
- - !ruby/object:Gem::Dependency
90
96
  requirement: !ruby/object:Gem::Requirement
91
97
  requirements:
92
98
  - - '>='
93
99
  - !ruby/object:Gem::Version
94
100
  version: '0'
95
- name: logstash-codec-json
96
101
  prerelease: false
97
102
  type: :development
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - '>='
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
103
  description: This is used to provide configuration options and connection settings for logstash plugins working with RabbitMQ
104
104
  email: info@elastic.co
105
105
  executables: []
@@ -107,8 +107,10 @@ extensions: []
107
107
  extra_rdoc_files: []
108
108
  files:
109
109
  - .gitignore
110
+ - CHANGELOG
110
111
  - Gemfile
111
112
  - README.md
113
+ - Rakefile
112
114
  - lib/logstash/plugin_mixins/rabbitmq_connection.rb
113
115
  - logstash-mixin-rabbitmq_connection.gemspec
114
116
  - spec/plugin_mixins/rabbitmq_connection_spec.rb
@@ -132,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
134
  version: '0'
133
135
  requirements: []
134
136
  rubyforge_project:
135
- rubygems_version: 2.4.8
137
+ rubygems_version: 2.1.9
136
138
  signing_key:
137
139
  specification_version: 4
138
140
  summary: Common functionality for RabbitMQ plugins