fluent-plugin-nsq 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fluent/plugin/in_nsq.rb +5 -2
- metadata +1 -1
data/lib/fluent/plugin/in_nsq.rb
CHANGED
@@ -6,6 +6,7 @@ module Fluent
|
|
6
6
|
|
7
7
|
config_param :topic, :string, default: nil
|
8
8
|
config_param :channel, :string, default: 'fluent_nsq_input'
|
9
|
+
config_param :in_flight, :integer, default: 100
|
9
10
|
config_param :nsqlookupd, :string, default: nil
|
10
11
|
config_param :tag, :string, default: '_key'
|
11
12
|
config_param :time_key, :string, default: nil
|
@@ -34,6 +35,7 @@ module Fluent
|
|
34
35
|
fail ConfigError, 'Missing nsqlookupd' unless @nsqlookupd
|
35
36
|
fail ConfigError, 'Missing topic' unless @topic
|
36
37
|
fail ConfigError, 'Missing channel' unless @channel
|
38
|
+
fail ConfigError, 'in_flight needs to be bigger than 0' unless @in_flight > 0
|
37
39
|
end
|
38
40
|
|
39
41
|
def start
|
@@ -42,7 +44,8 @@ module Fluent
|
|
42
44
|
@consumer = Nsq::Consumer.new(
|
43
45
|
nsqlookupd: lookupds,
|
44
46
|
topic: @topic,
|
45
|
-
channel: @channel
|
47
|
+
channel: @channel,
|
48
|
+
max_in_flight: @in_flight
|
46
49
|
)
|
47
50
|
@running = true
|
48
51
|
@thread = Thread.new(&method(:consume))
|
@@ -88,7 +91,7 @@ module Fluent
|
|
88
91
|
if @time_key
|
89
92
|
record[@time_key]
|
90
93
|
else
|
91
|
-
msg.timestamp
|
94
|
+
msg.timestamp.to_i
|
92
95
|
end
|
93
96
|
end
|
94
97
|
end
|