logstash-integration-kafka 11.2.0-java → 11.2.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/inputs/kafka.rb +7 -1
- data/logstash-integration-kafka.gemspec +1 -1
- data/spec/unit/inputs/kafka_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa69555ca0e7780e4f9ffb16c0a3308396bab86436009695708b1c03c11a7a96
|
4
|
+
data.tar.gz: e28f2ac5e38ba7cb1289496b3c633756a2607f2d37fee36fd19cc44b8abedf93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc63838c9baf545fffc3984e94faf73e72d8b97d7b4c04af12fc8de639ca55500b50255d1fcf7c6f684e49a2db763adccddb93a3df495301d66a8be769fae3f1
|
7
|
+
data.tar.gz: 540628833b9b3ab000046c07d5143812ce945de4788c58cb66680ff9c8e9d9ebdff8cb82042c52e0bbfa5a806b2deeb04ece1e8bc5e16b73edcf7f38c3be9901
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 11.2.1
|
2
|
+
- Fix nil exception to empty headers of record during event metadata assignment [#140](https://github.com/logstash-plugins/logstash-integration-kafka/pull/140)
|
3
|
+
|
1
4
|
## 11.2.0
|
2
5
|
- Added TLS truststore and keystore settings specifically to access the schema registry [#137](https://github.com/logstash-plugins/logstash-integration-kafka/pull/137)
|
3
6
|
|
@@ -373,7 +373,9 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
|
|
373
373
|
event.set("[@metadata][kafka][timestamp]", record.timestamp)
|
374
374
|
end
|
375
375
|
if @metadata_mode.include?(:headers)
|
376
|
-
record.headers
|
376
|
+
record.headers
|
377
|
+
.select{|h| header_with_value(h) }
|
378
|
+
.each do |header|
|
377
379
|
s = String.from_java_bytes(header.value)
|
378
380
|
s.force_encoding(Encoding::UTF_8)
|
379
381
|
if s.valid_encoding?
|
@@ -499,4 +501,8 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
|
|
499
501
|
end
|
500
502
|
end
|
501
503
|
|
504
|
+
def header_with_value(header)
|
505
|
+
!header.nil? && !header.value.nil? && !header.key.nil?
|
506
|
+
end
|
507
|
+
|
502
508
|
end #class LogStash::Inputs::Kafka
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-integration-kafka'
|
3
|
-
s.version = '11.2.
|
3
|
+
s.version = '11.2.1'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = "Integration with Kafka - input and output plugins"
|
6
6
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline "+
|
@@ -287,6 +287,19 @@ describe LogStash::Inputs::Kafka do
|
|
287
287
|
subject.register
|
288
288
|
expect(subject.metadata_mode).to include(:record_props)
|
289
289
|
end
|
290
|
+
|
291
|
+
context "guards against nil header" do
|
292
|
+
let(:header) { double(:value => nil, :key => "k") }
|
293
|
+
let(:headers) { [ header ] }
|
294
|
+
let(:record) { double(:headers => headers, :topic => "topic", :partition => 0,
|
295
|
+
:offset => 123456789, :key => "someId", :timestamp => nil ) }
|
296
|
+
|
297
|
+
it "does not raise error when key is nil" do
|
298
|
+
subject.register
|
299
|
+
evt = LogStash::Event.new('message' => 'Hello')
|
300
|
+
expect { subject.maybe_set_metadata(evt, record) }.not_to raise_error
|
301
|
+
end
|
302
|
+
end
|
290
303
|
end
|
291
304
|
|
292
305
|
context 'with client_rack' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-integration-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.2.
|
4
|
+
version: 11.2.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|