ruby-kafka 0.6.3 → 0.6.4
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/README.md +1 -0
- data/lib/kafka/consumer.rb +13 -5
- data/lib/kafka/heartbeat.rb +7 -5
- data/lib/kafka/version.rb +1 -1
- 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: 863071de617edf01ec3b4282b1549197107f08d56c8c7235387b8ac79616b911
|
4
|
+
data.tar.gz: 784850369d5932d275028c7d41feba5da078026c58caa944cae792b1562c9bfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 050b0dd32483774d21b45826a3f96a649562504439688f3c612c9f341ca2944d996b8887cf07fafcd349fc94455faf7ea84b9862362d20b5c6a4a2253430bb88
|
7
|
+
data.tar.gz: cebc6b02cacbc0d5a0782e0e3f7719e05a043ced9beae5135c3d8ff5d5ad7188ab5bdb13be568bd916bce19485177479f63ea27fe4d0617e6fe48f8b572d7b3e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -411,6 +411,7 @@ Compression is enabled by passing the `compression_codec` parameter to `#produce
|
|
411
411
|
|
412
412
|
* `:snappy` for [Snappy](http://google.github.io/snappy/) compression.
|
413
413
|
* `:gzip` for [gzip](https://en.wikipedia.org/wiki/Gzip) compression.
|
414
|
+
* `:lz4` for [LZ4](https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)) compression.
|
414
415
|
|
415
416
|
By default, all message sets will be compressed if you specify a compression codec. To increase the compression threshold, set `compression_threshold` to an integer value higher than one.
|
416
417
|
|
data/lib/kafka/consumer.rb
CHANGED
@@ -235,7 +235,7 @@ module Kafka
|
|
235
235
|
mark_message_as_processed(message) if automatically_mark_as_processed
|
236
236
|
@offset_manager.commit_offsets_if_necessary
|
237
237
|
|
238
|
-
|
238
|
+
trigger_heartbeat
|
239
239
|
|
240
240
|
return if !@running
|
241
241
|
end
|
@@ -326,7 +326,7 @@ module Kafka
|
|
326
326
|
|
327
327
|
@offset_manager.commit_offsets_if_necessary
|
328
328
|
|
329
|
-
|
329
|
+
trigger_heartbeat
|
330
330
|
|
331
331
|
return if !@running
|
332
332
|
end
|
@@ -362,10 +362,18 @@ module Kafka
|
|
362
362
|
@offset_manager.mark_as_processed(message.topic, message.partition, message.offset)
|
363
363
|
end
|
364
364
|
|
365
|
-
def
|
366
|
-
@heartbeat.
|
365
|
+
def trigger_heartbeat
|
366
|
+
@heartbeat.trigger
|
367
367
|
end
|
368
368
|
|
369
|
+
def trigger_heartbeat!
|
370
|
+
@heartbeat.trigger!
|
371
|
+
end
|
372
|
+
|
373
|
+
# Aliases for the external API compatibility
|
374
|
+
alias send_heartbeat_if_necessary trigger_heartbeat
|
375
|
+
alias send_heartbeat trigger_heartbeat!
|
376
|
+
|
369
377
|
private
|
370
378
|
|
371
379
|
def consumer_loop
|
@@ -488,7 +496,7 @@ module Kafka
|
|
488
496
|
|
489
497
|
join_group unless @group.member?
|
490
498
|
|
491
|
-
|
499
|
+
trigger_heartbeat
|
492
500
|
|
493
501
|
resume_paused_partitions!
|
494
502
|
|
data/lib/kafka/heartbeat.rb
CHANGED
@@ -8,11 +8,13 @@ module Kafka
|
|
8
8
|
@last_heartbeat = Time.now
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
def trigger!
|
12
|
+
@group.heartbeat
|
13
|
+
@last_heartbeat = Time.now
|
14
|
+
end
|
15
|
+
|
16
|
+
def trigger
|
17
|
+
trigger! if Time.now > @last_heartbeat + @interval
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
data/lib/kafka/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schierbeck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|