logstash-input-stomp 2.0.2 → 2.0.3
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.md +4 -2
- data/CONTRIBUTORS +4 -0
- data/README.md +3 -0
- data/lib/logstash/inputs/stomp.rb +10 -10
- data/logstash-input-stomp.gemspec +1 -2
- data/spec/inputs/stomp_spec.rb +31 -2
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68117f4113aa4a4902cb64977cb39d7fe88dd7bd
|
4
|
+
data.tar.gz: 4ac677fb36cb57017286f47504832615693478be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 127e2e00f45257a518175f4686a4358c91f78ea6cc750ebb8a783dd3fd2b2c339cb43e9140c59120b6638221948940ccc98c91c4765061e0a73f40901cefb7fe
|
7
|
+
data.tar.gz: b54f4532a6c3d00bef14598d313b5e678131fb86e036b4f68eab306114ce5741e0e498bd910ede688546fd893c21001780f25c910028668f19c689ccbd6c7912
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
## 2.0.3
|
2
|
+
- Bugfix https://github.com/logstash-plugins/logstash-input-stomp/issues/10
|
3
|
+
|
1
4
|
## 2.0.0
|
2
|
-
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
5
|
+
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
3
6
|
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
4
7
|
- Dependency on logstash-core update to 2.0
|
5
|
-
|
data/CONTRIBUTORS
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
The following is a list of people who have contributed ideas, code, bug
|
2
2
|
reports, or in general have helped logstash along its way.
|
3
3
|
|
4
|
+
Maintainers:
|
5
|
+
|
6
|
+
* Philippe Weber (wiibaa)
|
7
|
+
|
4
8
|
Contributors:
|
5
9
|
* Aaron Mildenstein (untergeek)
|
6
10
|
* Brice Figureau (masterzen)
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
+
[](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-stomp-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.
|
@@ -36,10 +36,10 @@ class LogStash::Inputs::Stomp < LogStash::Inputs::Base
|
|
36
36
|
private
|
37
37
|
def connect
|
38
38
|
begin
|
39
|
-
client.connect
|
40
|
-
@logger.debug("Connected to stomp server") if client.connected?
|
41
|
-
rescue => e
|
42
|
-
@logger.
|
39
|
+
@client.connect
|
40
|
+
@logger.debug? && @logger.debug("Connected to stomp server") if @client.connected?
|
41
|
+
rescue OnStomp::ConnectFailedError, OnStomp::UnsupportedProtocolVersionError=> e
|
42
|
+
@logger.warn("Failed to connect to stomp server, will retry", :exception => e, :backtrace => e.backtrace)
|
43
43
|
if stop?
|
44
44
|
sleep 2
|
45
45
|
retry
|
@@ -50,12 +50,12 @@ class LogStash::Inputs::Stomp < LogStash::Inputs::Base
|
|
50
50
|
public
|
51
51
|
def register
|
52
52
|
require "onstomp"
|
53
|
-
client = new_client
|
54
|
-
client.host = @vhost if @vhost
|
53
|
+
@client = new_client
|
54
|
+
@client.host = @vhost if @vhost
|
55
55
|
@stomp_url = "stomp://#{@user}:#{@password}@#{@host}:#{@port}/#{@destination}"
|
56
56
|
|
57
|
-
# Handle disconnects
|
58
|
-
client.on_connection_closed {
|
57
|
+
# Handle disconnects
|
58
|
+
@client.on_connection_closed {
|
59
59
|
connect
|
60
60
|
subscription_handler # is required for re-subscribing to the destination
|
61
61
|
}
|
@@ -68,7 +68,7 @@ class LogStash::Inputs::Stomp < LogStash::Inputs::Base
|
|
68
68
|
|
69
69
|
private
|
70
70
|
def subscription_handler
|
71
|
-
client.subscribe(@destination) do |msg|
|
71
|
+
@client.subscribe(@destination) do |msg|
|
72
72
|
@codec.decode(msg.body) do |event|
|
73
73
|
decorate(event)
|
74
74
|
@output_queue << event
|
@@ -87,7 +87,7 @@ class LogStash::Inputs::Stomp < LogStash::Inputs::Base
|
|
87
87
|
|
88
88
|
public
|
89
89
|
def run(output_queue)
|
90
|
-
@output_queue = output_queue
|
90
|
+
@output_queue = output_queue
|
91
91
|
subscription_handler
|
92
92
|
end # def run
|
93
93
|
end # class LogStash::Inputs::Stomp
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-stomp'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.3'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Pull events from a stomp server"
|
7
7
|
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"
|
@@ -27,4 +27,3 @@ Gem::Specification.new do |s|
|
|
27
27
|
|
28
28
|
s.add_development_dependency 'logstash-devutils'
|
29
29
|
end
|
30
|
-
|
data/spec/inputs/stomp_spec.rb
CHANGED
@@ -2,14 +2,43 @@ require "logstash/devutils/rspec/spec_helper"
|
|
2
2
|
require "logstash/inputs/stomp"
|
3
3
|
|
4
4
|
describe LogStash::Inputs::Stomp do
|
5
|
+
let(:klass) { LogStash::Inputs::Stomp }
|
6
|
+
let(:host) { "localhost" }
|
7
|
+
let(:destination) { "/foo" }
|
8
|
+
let(:stomp_settings) {
|
9
|
+
{
|
10
|
+
"host" => host,
|
11
|
+
"destination" => destination
|
12
|
+
}
|
13
|
+
}
|
14
|
+
let(:instance) { klass.new(stomp_settings) }
|
15
|
+
|
16
|
+
context "when connected" do
|
17
|
+
let(:client) { double("client") }
|
18
|
+
|
19
|
+
before do
|
20
|
+
allow(instance).to receive(:new_client).and_return(client)
|
21
|
+
allow(client).to receive(:connect)
|
22
|
+
allow(client).to receive(:connected?).and_return(true)
|
23
|
+
allow(client).to receive(:on_connection_closed)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should register without error" do
|
27
|
+
instance.register
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
5
31
|
describe "stopping" do
|
6
32
|
let(:config) { {"host" => "localhost", "destination" => "/foo"} }
|
7
33
|
let(:client) { double("client") }
|
8
34
|
before do
|
9
|
-
subject.
|
35
|
+
allow(subject).to receive(:new_client).and_return(client)
|
10
36
|
allow(subject).to receive(:connect)
|
37
|
+
allow(client).to receive(:connect)
|
38
|
+
allow(client).to receive(:connected?).and_return(true)
|
39
|
+
allow(client).to receive(:on_connection_closed)
|
11
40
|
allow(client).to receive(:subscribe)
|
12
41
|
end
|
13
42
|
it_behaves_like "an interruptible input plugin"
|
14
43
|
end
|
15
|
-
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-stomp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-20 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,48 +28,50 @@ 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: logstash-codec-plain
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
34
40
|
requirement: !ruby/object:Gem::Requirement
|
35
41
|
requirements:
|
36
42
|
- - '>='
|
37
43
|
- !ruby/object:Gem::Version
|
38
44
|
version: '0'
|
39
|
-
name: logstash-codec-plain
|
40
45
|
prerelease: false
|
41
46
|
type: :runtime
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: onstomp
|
42
49
|
version_requirements: !ruby/object:Gem::Requirement
|
43
50
|
requirements:
|
44
51
|
- - '>='
|
45
52
|
- !ruby/object:Gem::Version
|
46
53
|
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
54
|
requirement: !ruby/object:Gem::Requirement
|
49
55
|
requirements:
|
50
56
|
- - '>='
|
51
57
|
- !ruby/object:Gem::Version
|
52
58
|
version: '0'
|
53
|
-
name: onstomp
|
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
67
|
version: '0'
|
61
|
-
- !ruby/object:Gem::Dependency
|
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
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - '>='
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
75
75
|
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
|
76
76
|
email: info@elastic.co
|
77
77
|
executables: []
|