logstash-mixin-rabbitmq_connection 2.0.2-java → 2.1.1-java
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 +4 -4
- data/CHANGELOG +11 -0
- data/Rakefile +1 -0
- data/lib/logstash/plugin_mixins/rabbitmq_connection.rb +15 -1
- data/logstash-mixin-rabbitmq_connection.gemspec +1 -2
- data/spec/plugin_mixins/rabbitmq_connection_spec.rb +18 -1
- metadata +27 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dcab8d78a4949e57c440fcef4d467a988850c38
|
4
|
+
data.tar.gz: d8ae8f4162be1ab1b209bc7691c5e80c80b10e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eecfa540f15d9035b3ee1d06af65385b2fba199236fe282619bada989e4fce502365d41f1b0008597426c3b6256fbcf7ddc39614caba8447b716ae9bcbeb3cf2
|
7
|
+
data.tar.gz: 9080f84ca00d661e2e8e9e1af104fe0ab8cbc781cbccf9ff29663fd2e2428c985b61e1ae504e7e5b89bf1ea2ab6b929420adb0c932ec00a14ee0990c871072d6
|
data/CHANGELOG
ADDED
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.
|
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.
|
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-
|
11
|
+
date: 2015-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
|
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
|
-
|
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:
|
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
|
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.
|
137
|
+
rubygems_version: 2.1.9
|
136
138
|
signing_key:
|
137
139
|
specification_version: 4
|
138
140
|
summary: Common functionality for RabbitMQ plugins
|