ruby-kafka 0.3.13.beta3 → 0.3.13.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/kafka.rb +1 -0
- data/lib/kafka/consumer.rb +6 -0
- data/lib/kafka/consumer_group.rb +1 -1
- data/lib/kafka/fetch_operation.rb +5 -0
- data/lib/kafka/offset_manager.rb +5 -0
- data/lib/kafka/producer.rb +4 -1
- data/lib/kafka/snappy_codec.rb +3 -0
- data/lib/kafka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74dfff5457403137f170938a453a12e1288fd3f7
|
4
|
+
data.tar.gz: 03074ef585e3a46b45b703ed1efa13ef89e32062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88a1fc91d4d4b6b1a5aa1250e6f9a5b2a178d1bdb3233531d588ba8440072b64282ae17e866e0812ecbc502ff7ad418d3a0925d04ba710767d28f65af63890e0
|
7
|
+
data.tar.gz: 5a3a5b05c8d30679c528bf532584946d762a6d8c038f93e62958119db7f79699e503cb7a14164de43d008e9681cf8f6aca14be2f1ed2da0c7d36fdf1b7791573
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ Changes and additions to the library will be listed here.
|
|
4
4
|
|
5
5
|
## Unreleased
|
6
6
|
|
7
|
+
## v0.3.13.beta4
|
8
|
+
|
9
|
+
- Automatically recover from invalid consumer checkpoints.
|
10
|
+
|
7
11
|
## v0.3.13.beta1
|
8
12
|
|
9
13
|
- Minimize the number of times messages are reprocessed after a consumer group resync.
|
data/lib/kafka.rb
CHANGED
data/lib/kafka/consumer.rb
CHANGED
@@ -263,6 +263,12 @@ module Kafka
|
|
263
263
|
end
|
264
264
|
|
265
265
|
operation.execute
|
266
|
+
rescue OffsetOutOfRange => e
|
267
|
+
@logger.error "Invalid offset for #{e.topic}/#{e.partition}, resetting to default offset"
|
268
|
+
|
269
|
+
@offset_manager.seek_to_default(e.topic, e.partition)
|
270
|
+
|
271
|
+
retry
|
266
272
|
rescue ConnectionError => e
|
267
273
|
@logger.error "Connection error while fetching messages: #{e}"
|
268
274
|
|
data/lib/kafka/consumer_group.rb
CHANGED
@@ -71,6 +71,11 @@ module Kafka
|
|
71
71
|
fetched_topic.partitions.map {|fetched_partition|
|
72
72
|
begin
|
73
73
|
Protocol.handle_error(fetched_partition.error_code)
|
74
|
+
rescue Kafka::OffsetOutOfRange => e
|
75
|
+
e.topic = fetched_topic.name
|
76
|
+
e.partition = fetched_partition.partition
|
77
|
+
|
78
|
+
raise e
|
74
79
|
rescue Kafka::Error => e
|
75
80
|
topic = fetched_topic.name
|
76
81
|
partition = fetched_partition.partition
|
data/lib/kafka/offset_manager.rb
CHANGED
@@ -26,6 +26,11 @@ module Kafka
|
|
26
26
|
@logger.debug "Marking #{topic}/#{partition}:#{offset} as committed"
|
27
27
|
end
|
28
28
|
|
29
|
+
def seek_to_default(topic, partition)
|
30
|
+
@processed_offsets[topic] ||= {}
|
31
|
+
@processed_offsets[topic][partition] = -1
|
32
|
+
end
|
33
|
+
|
29
34
|
def next_offset_for(topic, partition)
|
30
35
|
offset = @processed_offsets.fetch(topic, {}).fetch(partition) {
|
31
36
|
committed_offset_for(topic, partition)
|
data/lib/kafka/producer.rb
CHANGED
@@ -360,7 +360,10 @@ module Kafka
|
|
360
360
|
end
|
361
361
|
|
362
362
|
if failed_messages.any?
|
363
|
-
|
363
|
+
failed_messages.group_by(&:topic).each do |topic, messages|
|
364
|
+
@logger.error "Failed to assign partitions to #{messages.count} messages in #{topic}"
|
365
|
+
end
|
366
|
+
|
364
367
|
@cluster.mark_as_stale!
|
365
368
|
end
|
366
369
|
|
data/lib/kafka/snappy_codec.rb
CHANGED
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.3.13.
|
4
|
+
version: 0.3.13.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schierbeck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|