logstash-output-kafka 7.3.2 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -2
- data/lib/logstash/outputs/kafka.rb +7 -15
- data/logstash-output-kafka.gemspec +1 -1
- data/spec/unit/outputs/kafka_spec.rb +1 -51
- 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: a981761a88f5164e806a8905d0029f5c9cae7c0e8c3c3fcda75a6c2f0e1ba376
|
4
|
+
data.tar.gz: dfff30a2b2945f37011d6c017ef24a3a4d59364a4f89b71cdc828990299ce848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95dd113a68bef32a2f2fcfca611ae82d11087697af6ea13ba122ffc070da65a4bacf9019d3db1a60f8d16a1d65d09dc3e1a682e3a26f1fc37405e75a88b7dfc1
|
7
|
+
data.tar.gz: f86de71028de564096d0f85f1d46e95edee7c7fe84834f2e44115934da43a008019cef0ad5956f478e8bad968b16f84ebfdf6024e05c8b100fd18af879041acf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
##
|
2
|
-
-
|
1
|
+
## 8.0.0
|
2
|
+
- Removed obsolete `block_on_buffer_full`, `ssl` and `timeout_ms` options
|
3
3
|
|
4
4
|
## 7.3.1
|
5
5
|
- Added support for kafka property `ssl.endpoint.identification.algorithm` [#213](https://github.com/logstash-plugins/logstash-output-kafka/pull/213)
|
@@ -73,8 +73,6 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
|
|
73
73
|
# `host1:port1,host2:port2`, and the list can be a subset of brokers or a VIP pointing to a
|
74
74
|
# subset of brokers.
|
75
75
|
config :bootstrap_servers, :validate => :string, :default => 'localhost:9092'
|
76
|
-
|
77
|
-
config :block_on_buffer_full, :validate => :boolean, :obsolete => "This options is obsolete"
|
78
76
|
# The total bytes of memory the producer can use to buffer records waiting to be sent to the server.
|
79
77
|
config :buffer_memory, :validate => :number, :default => 33554432
|
80
78
|
# The compression type for all data generated by the producer.
|
@@ -124,8 +122,6 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
|
|
124
122
|
config :retry_backoff_ms, :validate => :number, :default => 100
|
125
123
|
# The size of the TCP send buffer to use when sending data.
|
126
124
|
config :send_buffer_bytes, :validate => :number, :default => 131072
|
127
|
-
# Enable SSL/TLS secured communication to Kafka broker.
|
128
|
-
config :ssl, :validate => :boolean, :obsolete => "Use security_protocol => 'SSL'"
|
129
125
|
# The truststore type.
|
130
126
|
config :ssl_truststore_type, :validate => :string
|
131
127
|
# The JKS truststore path to validate the Kafka broker's certificate.
|
@@ -171,8 +167,6 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
|
|
171
167
|
# Optional path to kerberos config file. This is krb5.conf style as detailed in https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html
|
172
168
|
config :kerberos_config, :validate => :path
|
173
169
|
|
174
|
-
config :timeout_ms, :validate => :number, :obsolete => "This option is obsolete. Please use request_timeout_ms"
|
175
|
-
|
176
170
|
# The topic to produce messages to
|
177
171
|
config :topic_id, :validate => :string, :required => true
|
178
172
|
# Serializer class for the value of the message
|
@@ -231,7 +225,7 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
|
|
231
225
|
end
|
232
226
|
|
233
227
|
def retrying_send(batch)
|
234
|
-
remaining = @retries
|
228
|
+
remaining = @retries;
|
235
229
|
|
236
230
|
while batch.any?
|
237
231
|
if !remaining.nil?
|
@@ -281,15 +275,13 @@ class LogStash::Outputs::Kafka < LogStash::Outputs::Base
|
|
281
275
|
break if failures.empty?
|
282
276
|
|
283
277
|
# Otherwise, retry with any failed transmissions
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
batch = failures
|
290
|
-
sleep(delay)
|
291
|
-
end
|
278
|
+
batch = failures
|
279
|
+
delay = @retry_backoff_ms / 1000.0
|
280
|
+
logger.info("Sending batch to Kafka failed. Will retry after a delay.", :batch_size => batch.size,
|
281
|
+
:failures => failures.size, :sleep => delay);
|
282
|
+
sleep(delay)
|
292
283
|
end
|
284
|
+
|
293
285
|
end
|
294
286
|
|
295
287
|
def close
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-kafka'
|
4
|
-
s.version = '
|
4
|
+
s.version = '8.0.0'
|
5
5
|
s.licenses = ['Apache-2.0']
|
6
6
|
s.summary = "Writes events to a Kafka topic"
|
7
7
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
@@ -49,7 +49,7 @@ describe "outputs/kafka" do
|
|
49
49
|
kafka.register
|
50
50
|
kafka.multi_receive([event])
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
it 'should raise config error when truststore location is not set and ssl is enabled' do
|
54
54
|
kafka = LogStash::Outputs::Kafka.new(simple_kafka_config.merge("security_protocol" => "SSL"))
|
55
55
|
expect { kafka.register }.to raise_error(LogStash::ConfigurationError, /ssl_truststore_location must be set when SSL is enabled/)
|
@@ -120,41 +120,6 @@ describe "outputs/kafka" do
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
-
context 'when retries is 0' do
|
124
|
-
let(:retries) { 0 }
|
125
|
-
let(:max_sends) { 1 }
|
126
|
-
|
127
|
-
it "should should only send once" do
|
128
|
-
expect_any_instance_of(org.apache.kafka.clients.producer.KafkaProducer).to receive(:send)
|
129
|
-
.once
|
130
|
-
.and_wrap_original do |m, *args|
|
131
|
-
# Always fail.
|
132
|
-
future = java.util.concurrent.FutureTask.new { raise "Failed" }
|
133
|
-
future.run
|
134
|
-
future
|
135
|
-
end
|
136
|
-
kafka = LogStash::Outputs::Kafka.new(simple_kafka_config.merge("retries" => retries))
|
137
|
-
kafka.register
|
138
|
-
kafka.multi_receive([event])
|
139
|
-
end
|
140
|
-
|
141
|
-
it 'should not sleep' do
|
142
|
-
expect_any_instance_of(org.apache.kafka.clients.producer.KafkaProducer).to receive(:send)
|
143
|
-
.once
|
144
|
-
.and_wrap_original do |m, *args|
|
145
|
-
# Always fail.
|
146
|
-
future = java.util.concurrent.FutureTask.new { raise "Failed" }
|
147
|
-
future.run
|
148
|
-
future
|
149
|
-
end
|
150
|
-
|
151
|
-
kafka = LogStash::Outputs::Kafka.new(simple_kafka_config.merge("retries" => retries))
|
152
|
-
expect(kafka).not_to receive(:sleep).with(anything)
|
153
|
-
kafka.register
|
154
|
-
kafka.multi_receive([event])
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
123
|
context "and when retries is set by the user" do
|
159
124
|
let(:retries) { (rand * 10).to_i }
|
160
125
|
let(:max_sends) { retries + 1 }
|
@@ -172,21 +137,6 @@ describe "outputs/kafka" do
|
|
172
137
|
kafka.register
|
173
138
|
kafka.multi_receive([event])
|
174
139
|
end
|
175
|
-
|
176
|
-
it 'should only sleep retries number of times' do
|
177
|
-
expect_any_instance_of(org.apache.kafka.clients.producer.KafkaProducer).to receive(:send)
|
178
|
-
.at_most(max_sends)
|
179
|
-
.and_wrap_original do |m, *args|
|
180
|
-
# Always fail.
|
181
|
-
future = java.util.concurrent.FutureTask.new { raise "Failed" }
|
182
|
-
future.run
|
183
|
-
future
|
184
|
-
end
|
185
|
-
kafka = LogStash::Outputs::Kafka.new(simple_kafka_config.merge("retries" => retries))
|
186
|
-
expect(kafka).to receive(:sleep).exactly(retries).times
|
187
|
-
kafka.register
|
188
|
-
kafka.multi_receive([event])
|
189
|
-
end
|
190
140
|
end
|
191
141
|
end
|
192
142
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elasticsearch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|