fluent-plugin-kafka 0.16.0 → 0.16.1

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
  SHA256:
3
- metadata.gz: 7fcaf3e8fbb836ab8db3fa21003a713f9048de076097e2c95a9f30e5d1b05c08
4
- data.tar.gz: 8437b2c9401238d811973422a65d2c9ee34bd8afc513f32412a22f93e03204a0
3
+ metadata.gz: 5f03efe1dee8bff74ba9e0588956bc919244ac6ddf24ff40821d072602dab916
4
+ data.tar.gz: b081913e347f5dd28d1339a1eca3f063661217fa4f1738787161cb825c3485fc
5
5
  SHA512:
6
- metadata.gz: 6d407e6f12dbafc6f5fad59ac6cbae4b13fa5f0a212cf82dba604f871afc286899290972b3afca5d1031888ee2f141c12d5d2e3d6b7324c7246317029149c491
7
- data.tar.gz: b278441842361cc53836fce087e87e6d2d800bccbe9b307c2f0b39d3c4c357aae96275d2bfb808ab2455ebce692948d1241f4f991a5036473da1d31da699832b
6
+ metadata.gz: 03e89037f5982ca8aa121c1c1672160e95fb488ee7e9ca6bd8038e8d9b0cc9d99348ab91a2e1896e174fed4fa2b4c25fb9e65ee72b9a4ba74062c631953ca345
7
+ data.tar.gz: 5ca6f6093a1f46ab89b4b268416c16d9758102b76fcdb2bba8d2f235daa7b88e9914e48a0e4d0397df13ea9159a21ba1bbe525186670fd7b7622cfdd3d2cac2f
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 0.16.1 - 2021/04/14
2
+ * out_kafka/out_kafka_buffered: Support Ruby 3.0.0 keyword arguments interop
3
+ * kafka_plugin_util: Treat empty string in read_ssl_file as nil
4
+
1
5
  Release 0.16.0 - 2021/01/25
2
6
 
3
7
  * input: Add `tag_source` and `record_tag_key` parameters for using record field as tag
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "fluent-plugin-kafka"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = '0.16.0'
16
+ gem.version = '0.16.1'
17
17
  gem.required_ruby_version = ">= 2.1.0"
18
18
 
19
19
  gem.add_dependency "fluentd", [">= 0.10.58", "< 2"]
@@ -33,7 +33,7 @@ module Fluent
33
33
  end
34
34
 
35
35
  def read_ssl_file(path)
36
- return nil if path.nil?
36
+ return nil if path.nil? || path.respond_to?(:strip) && path.strip.empty?
37
37
 
38
38
  if path.is_a?(Array)
39
39
  path.map { |fp| File.read(fp) }
@@ -215,7 +215,7 @@ DESC
215
215
  chain.next
216
216
 
217
217
  # out_kafka is mainly for testing so don't need the performance unlike out_kafka_buffered.
218
- producer = @kafka.producer(@producer_opts)
218
+ producer = @kafka.producer(**@producer_opts)
219
219
 
220
220
  es.each do |time, record|
221
221
  if @output_include_time
@@ -239,7 +239,7 @@ DESC
239
239
  @producers_mutex.synchronize {
240
240
  producer = @producers[Thread.current.object_id]
241
241
  unless producer
242
- producer = @kafka.producer(@producer_opts)
242
+ producer = @kafka.producer(**@producer_opts)
243
243
  @producers[Thread.current.object_id] = producer
244
244
  end
245
245
  producer
@@ -0,0 +1,38 @@
1
+ require 'helper'
2
+ require 'fluent/plugin/kafka_plugin_util'
3
+
4
+ class File
5
+ def File::read(path)
6
+ path
7
+ end
8
+ end
9
+
10
+ class KafkaPluginUtilTest < Test::Unit::TestCase
11
+
12
+ def self.config_param(name, type, options)
13
+ end
14
+ include Fluent::KafkaPluginUtil::SSLSettings
15
+
16
+ def config_param
17
+ end
18
+ def setup
19
+ Fluent::Test.setup
20
+ end
21
+
22
+ def test_read_ssl_file_when_nil
23
+ assert_equal(nil, read_ssl_file(nil))
24
+ end
25
+
26
+ def test_read_ssl_file_when_empty_string
27
+ assert_equal(nil, read_ssl_file(""))
28
+ end
29
+
30
+ def test_read_ssl_file_when_non_empty_path
31
+ assert_equal("path", read_ssl_file("path"))
32
+ end
33
+
34
+ def test_read_ssl_file_when_non_empty_array
35
+ assert_equal(["a","b"], read_ssl_file(["a","b"]))
36
+ end
37
+
38
+ end
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.16.0
4
+ version: 0.16.1
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: 2021-01-25 00:00:00.000000000 Z
12
+ date: 2021-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -135,6 +135,7 @@ files:
135
135
  - lib/fluent/plugin/out_rdkafka.rb
136
136
  - lib/fluent/plugin/out_rdkafka2.rb
137
137
  - test/helper.rb
138
+ - test/plugin/test_kafka_plugin_util.rb
138
139
  - test/plugin/test_out_kafka.rb
139
140
  homepage: https://github.com/fluent/fluent-plugin-kafka
140
141
  licenses:
@@ -155,10 +156,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  - !ruby/object:Gem::Version
156
157
  version: '0'
157
158
  requirements: []
158
- rubygems_version: 3.0.3
159
+ rubygems_version: 3.1.2
159
160
  signing_key:
160
161
  specification_version: 4
161
162
  summary: Fluentd plugin for Apache Kafka > 0.8
162
163
  test_files:
163
164
  - test/helper.rb
165
+ - test/plugin/test_kafka_plugin_util.rb
164
166
  - test/plugin/test_out_kafka.rb