fluent-plugin-kafka 0.6.2 → 0.6.3

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: a038696697cc60a6c53b5204dd2146cc5961bd8b
4
- data.tar.gz: cafd403c4c422ba5d8bfc0214cff9566838c498b
3
+ metadata.gz: 2b9941b6f4988f1fb14b5a0a591a81574411f915
4
+ data.tar.gz: '08c543d8db1c038e908584460e39a6a9df89e86c'
5
5
  SHA512:
6
- metadata.gz: c469841e4e3f21c907bdbcd44c27eb3e2f6de18086cf622eb4c67b603395aced8b37aab6cb4afd108a0199e620ec26f3cdbaf7a9ea298fb43e8b86e69a06fb0e
7
- data.tar.gz: ab2db78c09756aa938971495db83288b93647da1cb28de15050aee7dbbced2a87313c5ad261a3a3464fc7f6731af3a1396abc275828bed538ca82f50397175ba
6
+ metadata.gz: 253f7354704fecc1fa1d21bc84056727169fc9dcbcbde55afe595ae9c882213dae910c82bd2b7e34918169f9275f6a8ab031646405409a115912a92f93092b94
7
+ data.tar.gz: 87cdd5a750bc91c036901d64f76fda7ae874a7fcc16f9f573311bfc5a061492e6d5a3612c6c3378bf7ab34f7a99b8f6b029d75405a2ef240cf3bb40c709498f0
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 0.6.3 - 2017/11/14
2
+
3
+ * in_kafka_group: re-create consumer when error happens during event fetch
4
+
1
5
  Release 0.6.2 - 2017/11/1
2
6
 
3
7
  * Fix ltsv parsing issue which generates symbol keys
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "fluent-plugin-kafka"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = '0.6.2'
15
+ gem.version = '0.6.3'
16
16
  gem.required_ruby_version = ">= 2.1.0"
17
17
 
18
18
  gem.add_dependency "fluentd", [">= 0.10.58", "< 2"]
@@ -26,6 +26,7 @@ class Fluent::KafkaGroupInput < Fluent::Input
26
26
  config_param :time_format, :string, :default => nil,
27
27
  :desc => "Time format to be used to parse 'time' filed."
28
28
 
29
+ config_param :retry_wait_seconds, :integer, :default => 30
29
30
  # Kafka consumer options
30
31
  config_param :max_bytes, :integer, :default => 1048576,
31
32
  :desc => "Maximum number of bytes to fetch."
@@ -122,7 +123,7 @@ class Fluent::KafkaGroupInput < Fluent::Input
122
123
 
123
124
  def start
124
125
  super
125
-
126
+
126
127
  @kafka = Kafka.new(seed_brokers: @brokers,
127
128
  ssl_ca_cert: read_ssl_file(@ssl_ca_cert),
128
129
  ssl_client_cert: read_ssl_file(@ssl_client_cert),
@@ -152,7 +153,21 @@ class Fluent::KafkaGroupInput < Fluent::Input
152
153
  }
153
154
  consumer
154
155
  end
155
-
156
+
157
+ def reconnect_consumer
158
+ log.warn "Stopping Consumer"
159
+ consumer = @consumer
160
+ @consumer = nil
161
+ consumer.stop
162
+ log.warn "Could not connect to broker. Next retry will be in #{@retry_wait_seconds} seconds"
163
+ sleep @retry_wait_seconds
164
+ @consumer = setup_consumer
165
+ log.warn "Re-starting consumer #{Time.now.to_s}"
166
+ rescue =>e
167
+ log.error "unexpected error during re-starting consumer object access", :error => e.to_s
168
+ log.error_backtrace
169
+ end
170
+
156
171
  def run
157
172
  while @consumer
158
173
  begin
@@ -189,6 +204,7 @@ class Fluent::KafkaGroupInput < Fluent::Input
189
204
  rescue => e
190
205
  log.error "unexpected error during consuming events from kafka. Re-fetch events.", :error => e.to_s
191
206
  log.error_backtrace
207
+ reconnect_consumer
192
208
  end
193
209
  end
194
210
  rescue => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hidemasa Togashi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-02 00:00:00.000000000 Z
12
+ date: 2017-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd