fluent-plugin-nats 0.1.0 → 1.0.0
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/README.md +39 -1
- data/Rakefile +0 -2
- data/fluent-plugin-nats.gemspec +4 -3
- data/lib/fluent/plugin/in_nats.rb +74 -66
- data/test/nats-publish-message.rb +1 -1
- data/test/plugin/test_in_nats.rb +86 -83
- data/test/test_helper.rb +7 -27
- metadata +20 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37e3edf9206fe66e157aa2c2d8a0ae58e2f5d934
|
4
|
+
data.tar.gz: 22a579e710b96489e1a29cb67f7982409a7f5b6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20518c485938cf956976a732cfe8c3c64162834af602aac5dc0eb926c64942f9308933e8de083366aa22c25442122f8941abb14c48ec686fce587e0393e82215
|
7
|
+
data.tar.gz: 5a6b040380c3787da130b05d3a5c9bf93bda73e4d112289d56744714d5d4ee4f5e245a05a60d98c9f81bcd9d549fe951ad8336a17e000f88c9623cf40661d88a
|
data/README.md
CHANGED
@@ -6,6 +6,12 @@ fluent-plugin-nats
|
|
6
6
|
|
7
7
|
[](http://travis-ci.org/achied/fluent-plugin-nats)
|
8
8
|
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
| fluent-plugin-nats | Fluentd | Ruby |
|
12
|
+
|--------------------|-------------|--------|
|
13
|
+
| >= 1.0.0 | >= v0.14.20 | >= 2.1 |
|
14
|
+
| < 1.0.0 | >= v0.12.0 | >= 1.9 |
|
9
15
|
|
10
16
|
# Getting Started
|
11
17
|
Setup the NATS input:
|
@@ -18,7 +24,7 @@ Setup the NATS input:
|
|
18
24
|
port 4222
|
19
25
|
user nats
|
20
26
|
password nats
|
21
|
-
|
27
|
+
queues fluent.>,fluent2.>
|
22
28
|
ssl false
|
23
29
|
</source>
|
24
30
|
~~~~~
|
@@ -31,6 +37,38 @@ Setup the match output:
|
|
31
37
|
</match>
|
32
38
|
~~~~
|
33
39
|
|
40
|
+
# Configuration
|
41
|
+
|
42
|
+
## Plugin helpers
|
43
|
+
|
44
|
+
* thread
|
45
|
+
|
46
|
+
* See also: Fluent::Plugin::Input
|
47
|
+
|
48
|
+
## Fluent::Plugin::NATSInput
|
49
|
+
|
50
|
+
* **host** (string) (optional): NATS server hostname
|
51
|
+
* Default value: `localhost`
|
52
|
+
* **user** (string) (optional): Username for authorized connection
|
53
|
+
* Default value: `nats`
|
54
|
+
* **password** (string) (optional): Password for authorized connection
|
55
|
+
* Default value: `nats`
|
56
|
+
* **port** (integer) (optional): NATS server port
|
57
|
+
* Default value: `4222`
|
58
|
+
* **queues** (array) (optional): Subscribing queue names
|
59
|
+
* Default value: `["fluent.>"]`
|
60
|
+
* **queue** (string) (optional):
|
61
|
+
* Default value: `fluent.>`
|
62
|
+
* Obsoleted: Use `queues` instead
|
63
|
+
* **tag** (string) (optional): The tag prepend before queue name
|
64
|
+
* Default value: `nats`
|
65
|
+
* **ssl** (bool) (optional): Enable secure SSL/TLS connection
|
66
|
+
* Default value: `false`
|
67
|
+
* **max_reconnect_attempts** (integer) (optional): The max number of reconnect tries
|
68
|
+
* Default value: `150`
|
69
|
+
* **reconnect_time_wait** (integer) (optional): The number of seconds to wait between reconnect tries
|
70
|
+
* Default value: `2`
|
71
|
+
|
34
72
|
# Suitable Queues
|
35
73
|
|
36
74
|
## Components
|
data/Rakefile
CHANGED
@@ -6,8 +6,6 @@ Rake::TestTask.new(:test) do |test|
|
|
6
6
|
test.libs << 'lib' << 'test'
|
7
7
|
test.pattern = 'test/**/test_*.rb'
|
8
8
|
test.test_files = Dir['test/plugin/*.rb']
|
9
|
-
test.ruby_opts = ['-rubygems'] if defined? Gem
|
10
|
-
test.ruby_opts << '-I.'
|
11
9
|
test.verbose = false
|
12
10
|
test.warning = false
|
13
11
|
end
|
data/fluent-plugin-nats.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
$:.push File.expand_path("../lib", __FILE__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |gem|
|
5
4
|
gem.name = "fluent-plugin-nats"
|
6
|
-
gem.version = "
|
5
|
+
gem.version = "1.0.0"
|
7
6
|
gem.authors = ["Eduardo Aceituno"]
|
8
7
|
gem.email = ["achied@gmail.com"]
|
9
8
|
gem.homepage = "https://github.com/achied/fluent-plugin-nats"
|
10
9
|
gem.summary = %q{nats plugin for fluentd, an event collector}
|
11
10
|
gem.description = %q{nats plugin for fluentd, an event collector}
|
11
|
+
gem.license = "Apache-2.0"
|
12
12
|
|
13
13
|
gem.files = `git ls-files`.split("\n")
|
14
14
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -16,9 +16,10 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
|
18
18
|
gem.add_dependency "eventmachine", ">= 0.12.10"
|
19
|
-
gem.add_dependency "fluentd", ">= 0.
|
19
|
+
gem.add_dependency "fluentd", ">= 0.14.20"
|
20
20
|
gem.add_dependency "nats", ">= 0.4.22"
|
21
21
|
|
22
22
|
gem.add_development_dependency "rake", ">= 0.9.2"
|
23
23
|
gem.add_development_dependency "test-unit", "> 3.1"
|
24
|
+
gem.add_development_dependency "timecop"
|
24
25
|
end
|
@@ -1,83 +1,91 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Fluent::Plugin.register_input("nats", self)
|
1
|
+
require "fluent/plugin/input"
|
2
|
+
require "nats/client"
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
config_param :queue, :string, :default => "fluent.>"
|
10
|
-
config_param :tag, :string, :default => "nats"
|
11
|
-
config_param :ssl, :bool, :default => false
|
12
|
-
config_param :max_reconnect_attempts, :integer, :default => 150
|
13
|
-
config_param :reconnect_time_wait, :integer, :default => 2
|
4
|
+
module Fluent
|
5
|
+
module Plugin
|
6
|
+
class NATSInput < Fluent::Plugin::Input
|
7
|
+
Fluent::Plugin.register_input("nats", self)
|
14
8
|
|
15
|
-
|
16
|
-
require "nats/client"
|
9
|
+
helpers :thread
|
17
10
|
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
desc "NATS server hostname"
|
12
|
+
config_param :host, :string, default: "localhost"
|
13
|
+
desc "Username for authorized connection"
|
14
|
+
config_param :user, :string, default: "nats"
|
15
|
+
desc "Password for authorized connection"
|
16
|
+
config_param :password, :string, default: "nats", secret: true
|
17
|
+
desc "NATS server port"
|
18
|
+
config_param :port, :integer, default: 4222
|
19
|
+
desc "Subscribing queue names"
|
20
|
+
config_param :queues, :array, default: ["fluent.>"]
|
21
|
+
config_param :queue, :string, default: "fluent.>", obsoleted: "Use `queues` instead"
|
22
|
+
desc "The tag prepend before queue name"
|
23
|
+
config_param :tag, :string, default: "nats"
|
24
|
+
desc "Enable secure SSL/TLS connection"
|
25
|
+
config_param :ssl, :bool, default: false
|
26
|
+
desc "The max number of reconnect tries"
|
27
|
+
config_param :max_reconnect_attempts, :integer, default: 150
|
28
|
+
desc "The number of seconds to wait between reconnect tries"
|
29
|
+
config_param :reconnect_time_wait, :integer, default: 2
|
21
30
|
|
22
|
-
|
23
|
-
|
31
|
+
def configure(conf)
|
32
|
+
super
|
24
33
|
|
25
|
-
|
26
|
-
|
34
|
+
@nats_config = {
|
35
|
+
uri: "nats://#{@host}:#{@port}",
|
36
|
+
ssl: @ssl,
|
37
|
+
user: @user,
|
38
|
+
pass: @password,
|
39
|
+
reconnect_time_wait: @reconnect_time_wait,
|
40
|
+
max_reconnect_attempts: @max_reconnect_attempts,
|
41
|
+
}
|
27
42
|
end
|
28
43
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
def start
|
40
|
-
super
|
41
|
-
run_reactor_thread
|
42
|
-
@thread = Thread.new(&method(:run))
|
43
|
-
log.info "listening nats on #{@uri}/#{@queue}"
|
44
|
-
end
|
44
|
+
def start
|
45
|
+
super
|
46
|
+
NATS.on_error do |error_message|
|
47
|
+
log.error "Server Error: #{error_message}"
|
48
|
+
exit!
|
49
|
+
end
|
50
|
+
run_reactor_thread
|
51
|
+
thread_create(:nats_input_main, &method(:run))
|
52
|
+
log.info "listening nats on #{@uri}/#{@queue}"
|
53
|
+
end
|
45
54
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
@reactor_thread.join if @reactor_thread
|
52
|
-
end
|
55
|
+
def shutdown
|
56
|
+
@nats_conn.close
|
57
|
+
EM.stop if EM.reactor_running?
|
58
|
+
super
|
59
|
+
end
|
53
60
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
def run
|
62
|
+
EM.next_tick do
|
63
|
+
@nats_conn = NATS.connect(@nats_config) do
|
64
|
+
@queues.each do |queue|
|
65
|
+
@nats_conn.subscribe(queue) do |msg, _reply, sub|
|
66
|
+
tag = "#{@tag}.#{sub}"
|
67
|
+
begin
|
68
|
+
message = JSON.parse(msg)
|
69
|
+
rescue JSON::ParserError => e
|
70
|
+
log.error "Failed parsing JSON #{e.inspect}. Passing as a normal string"
|
71
|
+
message = msg
|
72
|
+
end
|
73
|
+
time = Engine.now
|
74
|
+
router.emit(tag, time, message || {})
|
66
75
|
end
|
67
|
-
time = Engine.now
|
68
|
-
router.emit(tag, time, msg_json || {})
|
69
76
|
end
|
70
77
|
end
|
71
|
-
|
72
|
-
|
73
|
-
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
74
82
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
83
|
+
def run_reactor_thread
|
84
|
+
return if EM.reactor_running?
|
85
|
+
thread_create(:nats_input_reactor_thread) do
|
86
|
+
EM.run
|
87
|
+
end
|
79
88
|
end
|
80
89
|
end
|
81
|
-
|
82
90
|
end
|
83
91
|
end
|
data/test/plugin/test_in_nats.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require 'nats/client'
|
5
|
-
require 'test_helper'
|
1
|
+
require "test_helper"
|
2
|
+
require "fluent/test/driver/input"
|
3
|
+
require "fluent/plugin/in_nats"
|
6
4
|
|
7
5
|
class NATSInputTest < Test::Unit::TestCase
|
8
6
|
include NATSTestHelper
|
@@ -16,13 +14,13 @@ class NATSInputTest < Test::Unit::TestCase
|
|
16
14
|
|
17
15
|
def basic_queue_conf
|
18
16
|
CONFIG + %[
|
19
|
-
|
17
|
+
queues fluent.>
|
20
18
|
]
|
21
19
|
end
|
22
20
|
|
23
21
|
def multiple_queue_conf
|
24
22
|
CONFIG + %[
|
25
|
-
|
23
|
+
queues fluent.>, fluent2.>
|
26
24
|
]
|
27
25
|
end
|
28
26
|
|
@@ -33,35 +31,45 @@ class NATSInputTest < Test::Unit::TestCase
|
|
33
31
|
end
|
34
32
|
|
35
33
|
def create_driver(conf)
|
36
|
-
Fluent::Test::
|
34
|
+
Fluent::Test::Driver::Input.new(Fluent::Plugin::NATSInput).configure(conf)
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup
|
38
|
+
Fluent::Test.setup
|
39
|
+
@time = Time.parse("2011-01-02 13:14:15 UTC")
|
40
|
+
Timecop.freeze(@time)
|
41
|
+
end
|
42
|
+
|
43
|
+
def teardown
|
44
|
+
Timecop.return
|
37
45
|
end
|
38
46
|
|
39
47
|
sub_test_case "configure" do
|
40
48
|
test "basic" do
|
41
49
|
d = create_driver basic_queue_conf
|
42
50
|
assert_equal 4222, d.instance.port
|
43
|
-
assert_equal
|
44
|
-
assert_equal
|
45
|
-
assert_equal
|
46
|
-
assert_equal
|
51
|
+
assert_equal "localhost", d.instance.host
|
52
|
+
assert_equal "nats", d.instance.user
|
53
|
+
assert_equal "nats", d.instance.password
|
54
|
+
assert_equal ["fluent.>"], d.instance.queues
|
47
55
|
end
|
48
56
|
|
49
57
|
test "multiple queue" do
|
50
58
|
d = create_driver multiple_queue_conf
|
51
59
|
assert_equal 4222, d.instance.port
|
52
|
-
assert_equal
|
53
|
-
assert_equal
|
54
|
-
assert_equal
|
55
|
-
assert_equal
|
60
|
+
assert_equal "localhost", d.instance.host
|
61
|
+
assert_equal "nats", d.instance.user
|
62
|
+
assert_equal "nats", d.instance.password
|
63
|
+
assert_equal ["fluent.>", "fluent2.>"], d.instance.queues
|
56
64
|
end
|
57
65
|
|
58
66
|
test "basic with ssl" do
|
59
67
|
d = create_driver ssl_conf
|
60
68
|
assert_equal 4222, d.instance.port
|
61
|
-
assert_equal
|
62
|
-
assert_equal
|
63
|
-
assert_equal
|
64
|
-
assert_equal
|
69
|
+
assert_equal "localhost", d.instance.host
|
70
|
+
assert_equal "nats", d.instance.user
|
71
|
+
assert_equal "nats", d.instance.password
|
72
|
+
assert_equal ["fluent.>"], d.instance.queues
|
65
73
|
assert_equal true, d.instance.ssl
|
66
74
|
end
|
67
75
|
end
|
@@ -70,154 +78,149 @@ class NATSInputTest < Test::Unit::TestCase
|
|
70
78
|
test "with credentials" do
|
71
79
|
d = create_driver basic_queue_conf
|
72
80
|
|
73
|
-
time =
|
74
|
-
Fluent::Engine.now = time
|
81
|
+
time = @time.to_i
|
75
82
|
|
76
|
-
|
77
|
-
|
83
|
+
records = [
|
84
|
+
["nats.fluent.test1", time, { "message" => "nats", "fluent_timestamp" => time }],
|
85
|
+
["nats.fluent.test2", time, { "message" => "nats", "fluent_timestamp" => time }]
|
86
|
+
]
|
78
87
|
|
79
88
|
uri = generate_uri(d)
|
80
89
|
|
81
90
|
run_server(uri) do
|
82
|
-
d.run do
|
83
|
-
|
91
|
+
d.run(expect_records: records.size, timeout: 5) do
|
92
|
+
records.each do |tag, _time, record|
|
84
93
|
send(uri, tag[5..-1], record)
|
85
|
-
|
86
|
-
}
|
94
|
+
end
|
87
95
|
end
|
96
|
+
assert_equal(records, d.events)
|
88
97
|
end
|
89
98
|
end
|
90
99
|
|
91
100
|
test "without credentials" do
|
92
101
|
d = create_driver basic_queue_conf
|
102
|
+
time = @time.to_i
|
93
103
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
d.expect_emit "nats.fluent.test2", time, {"message"=>'nats', "fluent_timestamp"=>time}
|
104
|
+
records = [
|
105
|
+
["nats.fluent.test1", time, { "message" => "nats", "fluent_timestamp" => time }],
|
106
|
+
["nats.fluent.test2", time, { "message" => "nats", "fluent_timestamp" => time }]
|
107
|
+
]
|
99
108
|
|
100
109
|
uri = generate_uri(d)
|
101
110
|
|
102
111
|
run_server(uri) do
|
103
|
-
d.run do
|
104
|
-
|
112
|
+
d.run(expect_records: records.size, timeout: 5) do
|
113
|
+
records.each do |tag, _time, record|
|
105
114
|
send(uri, tag[5..-1], record)
|
106
|
-
|
107
|
-
}
|
115
|
+
end
|
108
116
|
end
|
117
|
+
assert_equal(records, d.events)
|
109
118
|
end
|
110
119
|
end
|
111
120
|
|
112
121
|
test "multiple queues" do
|
113
122
|
d = create_driver multiple_queue_conf
|
123
|
+
time = @time.to_i
|
114
124
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
d.expect_emit "nats.fluent2.test2", time, {"message"=>'nats', "fluent_timestamp"=>time}
|
125
|
+
records = [
|
126
|
+
["nats.fluent.test1", time, { "message" => "nats", "fluent_timestamp" => time }],
|
127
|
+
["nats.fluent.test2", time, { "message" => "nats", "fluent_timestamp" => time }],
|
128
|
+
["nats.fluent2.test1", time, { "message" => "nats", "fluent_timestamp" => time }],
|
129
|
+
["nats.fluent2.test2", time, { "message" => "nats", "fluent_timestamp" => time }]
|
130
|
+
]
|
122
131
|
|
123
132
|
uri = generate_uri(d)
|
124
133
|
|
125
134
|
run_server(uri) do
|
126
|
-
d.run do
|
127
|
-
|
135
|
+
d.run(expect_records: records.size, timeout: 5) do
|
136
|
+
records.each do |tag, _time, record|
|
128
137
|
send(uri, tag[5..-1], record)
|
129
|
-
|
130
|
-
}
|
138
|
+
end
|
131
139
|
end
|
140
|
+
assert_equal(records, d.events)
|
132
141
|
end
|
133
142
|
end
|
134
143
|
|
135
144
|
test "without fluent timestamp" do
|
136
145
|
d = create_driver basic_queue_conf
|
137
|
-
|
138
146
|
time = Time.now.to_i
|
139
|
-
Fluent::Engine.now = time
|
140
147
|
|
141
|
-
|
148
|
+
records = [
|
149
|
+
["nats.fluent.test1", time, { "message" => "nats" }]
|
150
|
+
]
|
142
151
|
|
143
152
|
uri = generate_uri(d)
|
144
153
|
run_server(uri) do
|
145
|
-
d.run do
|
146
|
-
|
154
|
+
d.run(expect_records: records.size, timeout: 5) do
|
155
|
+
records.each do |tag, _time, record|
|
147
156
|
send(uri, tag[5..-1], record)
|
148
|
-
sleep 0.5
|
149
157
|
end
|
150
158
|
end
|
159
|
+
assert_equal(records, d.events)
|
151
160
|
end
|
152
161
|
end
|
153
162
|
|
154
163
|
test "arrays" do
|
155
164
|
d = create_driver basic_queue_conf
|
156
|
-
|
157
165
|
time = Time.now.to_i
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
uri = "nats://#{user}:#{password}@#{d.instance.host}:#{d.instance.port}"
|
166
|
+
|
167
|
+
records = [
|
168
|
+
["nats.fluent.empty_array", time, []],
|
169
|
+
["nats.fluent.string_array", time, %w(one two three)]
|
170
|
+
]
|
171
|
+
|
172
|
+
uri = generate_uri(d)
|
166
173
|
run_server(uri) do
|
167
|
-
d.run do
|
168
|
-
|
174
|
+
d.run(expect_records: records.size, timeout: 5) do
|
175
|
+
records.each do |tag, _time, record|
|
169
176
|
send(uri, tag[5..-1], record)
|
170
|
-
sleep 0.5
|
171
177
|
end
|
172
178
|
end
|
179
|
+
assert_equal(records, d.events)
|
173
180
|
end
|
174
181
|
end
|
175
182
|
|
176
183
|
test "empty publish string" do
|
177
184
|
d = create_driver basic_queue_conf
|
178
|
-
|
179
185
|
time = Time.now.to_i
|
180
|
-
Fluent::Engine.now = time
|
181
186
|
|
182
|
-
|
187
|
+
records = [
|
188
|
+
["nats.fluent.nil", time, {}]
|
189
|
+
]
|
183
190
|
|
184
191
|
uri = generate_uri(d)
|
185
192
|
run_server(uri) do
|
186
|
-
d.run do
|
187
|
-
|
193
|
+
d.run(expect_records: records.size, timeout: 5) do
|
194
|
+
records.each do |tag, _time, _record|
|
188
195
|
send(uri, tag[5..-1], nil)
|
189
|
-
sleep 0.5
|
190
196
|
end
|
191
197
|
end
|
198
|
+
assert_equal(records, d.events)
|
192
199
|
end
|
193
200
|
end
|
194
201
|
|
195
202
|
test "regular publish string" do
|
196
203
|
d = create_driver basic_queue_conf
|
197
|
-
|
198
204
|
time = Time.now.to_i
|
199
|
-
Fluent::Engine.now = time
|
200
205
|
|
201
|
-
|
206
|
+
records = [
|
207
|
+
["nats.fluent.string", time, "Lorem ipsum dolor sit amet"]
|
208
|
+
]
|
202
209
|
|
203
210
|
uri = generate_uri(d)
|
204
211
|
run_server(uri) do
|
205
|
-
d.run do
|
206
|
-
|
212
|
+
d.run(expect_records: records.size, timeout: 5) do
|
213
|
+
records.each do |tag, _time, _record|
|
207
214
|
send(uri, tag[5..-1], "Lorem ipsum dolor sit amet")
|
208
|
-
sleep 0.5
|
209
215
|
end
|
210
216
|
end
|
217
|
+
assert_equal(records, d.events)
|
211
218
|
end
|
212
219
|
end
|
213
220
|
end
|
214
221
|
|
215
|
-
def setup
|
216
|
-
Fluent::Test.setup
|
217
|
-
end
|
218
|
-
|
219
222
|
def send(uri, tag, msg)
|
220
|
-
system("test/nats-publish-message.rb",
|
223
|
+
system("test/nats-publish-message.rb", "--uri", uri, "--queue", tag, "--message", msg.to_json)
|
221
224
|
end
|
222
225
|
|
223
226
|
def generate_uri(driver)
|
data/test/test_helper.rb
CHANGED
@@ -1,31 +1,11 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'test/unit'
|
11
|
-
|
12
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
13
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
14
|
-
require 'fluent/test'
|
15
|
-
unless ENV.has_key?('VERBOSE')
|
16
|
-
nulllogger = Object.new
|
17
|
-
nulllogger.instance_eval {|obj|
|
18
|
-
def method_missing(method, *args)
|
19
|
-
# pass
|
20
|
-
end
|
21
|
-
}
|
22
|
-
$log = nulllogger
|
23
|
-
end
|
24
|
-
|
25
|
-
class Test::Unit::TestCase
|
26
|
-
end
|
1
|
+
require "bundler/setup"
|
2
|
+
require "test/unit"
|
27
3
|
|
28
|
-
|
4
|
+
$LOAD_PATH.unshift(File.join(__dir__, "..", "lib"))
|
5
|
+
$LOAD_PATH.unshift(__dir__)
|
6
|
+
require "fluent/test"
|
7
|
+
require "nats/client"
|
8
|
+
require "timecop"
|
29
9
|
|
30
10
|
module NATSTestHelper
|
31
11
|
def run_server(uri)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-nats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Aceituno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -30,20 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '0.14'
|
33
|
+
version: 0.14.20
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
38
|
- - ">="
|
42
39
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0.14'
|
40
|
+
version: 0.14.20
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: nats
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +80,20 @@ dependencies:
|
|
86
80
|
- - ">"
|
87
81
|
- !ruby/object:Gem::Version
|
88
82
|
version: '3.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: timecop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
89
97
|
description: nats plugin for fluentd, an event collector
|
90
98
|
email:
|
91
99
|
- achied@gmail.com
|
@@ -105,7 +113,8 @@ files:
|
|
105
113
|
- test/plugin/test_in_nats.rb
|
106
114
|
- test/test_helper.rb
|
107
115
|
homepage: https://github.com/achied/fluent-plugin-nats
|
108
|
-
licenses:
|
116
|
+
licenses:
|
117
|
+
- Apache-2.0
|
109
118
|
metadata: {}
|
110
119
|
post_install_message:
|
111
120
|
rdoc_options: []
|