ruby-kafka 0.6.8 → 0.7.0.alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b6ec4c0b038f80886220bb4bf822f159feb4fbaec4da32ff07a6bee61a29b8b
4
- data.tar.gz: 9be9c44da236f5703615cf6e79cf8aa31c607712d643fecdfc85ebde55d9ea09
3
+ metadata.gz: 3a913d7cca1f36c5d37398c39620db551399b18073ae1cc11eb110e0d32f8a39
4
+ data.tar.gz: 5ccef5d293d0d8732eb592496468f8f7840a4a8a62ca1982c0c81d7b224a2f93
5
5
  SHA512:
6
- metadata.gz: 39a98eca4842a975e07a1abde3f3956c3a142b35fbfeb3aa156d8191cfb6e990adbd2b373e9b4f8e361df6eb8e3ae4c2b9d4e7af593f9adc82b448a2fa89220b
7
- data.tar.gz: 1c32a30793cf9a774070a4a124d9587de7c74167d4ada87a3942471b90e3090b16b19d62f803f245232d03fadc44784c893a79f8e7842cdcbf005c9c754fe3b2
6
+ metadata.gz: e21b28dd124d83ca1c470f807e21ceb1d4c117a6aa9f22103f405752f4212fc5119d969b09e58a6bd35dfe56ea7611274dd79cb7c10fe8c573ce6031b3a8a547
7
+ data.tar.gz: dab421eb3da87aa62e134e16a0cafb73825df1ca09b7dd3c702d12e9235c303ec286b581b4f5c87fafc95ae19983d76db3995fb1eda5ef922ba1bae4f224bbbc
data/CHANGELOG.md CHANGED
@@ -4,13 +4,7 @@ Changes and additions to the library will be listed here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
- ## v0.6.5
8
-
9
- - Fix bug related to partition assignment.
10
-
11
- ## v0.6.4
12
-
13
- - Fix bug that caused consumers to jump back and reprocess messages (#595).
7
+ - Drop support for Kafka 0.10 in favor of native support for Kafka 0.11.
14
8
 
15
9
  ## v0.6.3
16
10
 
data/lib/kafka/client.rb CHANGED
@@ -470,7 +470,7 @@ module Kafka
470
470
 
471
471
  batches.each do |batch|
472
472
  batch.messages.each(&block)
473
- offsets[batch.partition] = batch.last_offset + 1 unless batch.empty?
473
+ offsets[batch.partition] = batch.last_offset + 1
474
474
  end
475
475
  end
476
476
  end
@@ -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
- trigger_heartbeat
238
+ @heartbeat.send_if_necessary
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
- trigger_heartbeat
329
+ @heartbeat.send_if_necessary
330
330
 
331
331
  return if !@running
332
332
  end
@@ -362,18 +362,10 @@ module Kafka
362
362
  @offset_manager.mark_as_processed(message.topic, message.partition, message.offset)
363
363
  end
364
364
 
365
- def trigger_heartbeat
366
- @heartbeat.trigger
365
+ def send_heartbeat_if_necessary
366
+ @heartbeat.send_if_necessary
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
-
377
369
  private
378
370
 
379
371
  def consumer_loop
@@ -496,7 +488,7 @@ module Kafka
496
488
 
497
489
  join_group unless @group.member?
498
490
 
499
- trigger_heartbeat
491
+ @heartbeat.send_if_necessary
500
492
 
501
493
  resume_paused_partitions!
502
494
 
@@ -509,9 +501,7 @@ module Kafka
509
501
 
510
502
  case tag
511
503
  when :batches
512
- # make sure any old batches, fetched prior to the completion of a consumer group sync,
513
- # are only processed if the batches are from brokers for which this broker is still responsible.
514
- message.select { |batch| @group.assigned_to?(batch.topic, batch.partition) }
504
+ message
515
505
  when :exception
516
506
  raise message
517
507
  end
@@ -31,10 +31,6 @@ module Kafka
31
31
  @assigned_partitions.select { |topic, _| @topics.include?(topic) }
32
32
  end
33
33
 
34
- def assigned_to?(topic, partition)
35
- subscribed_partitions.fetch(topic, []).include?(partition)
36
- end
37
-
38
34
  def member?
39
35
  !@generation_id.nil?
40
36
  end
@@ -109,7 +109,7 @@ module Kafka
109
109
  }
110
110
  }
111
111
  }
112
- rescue Kafka::ConnectionError, Kafka::LeaderNotAvailable, Kafka::NotLeaderForPartition, Kafka::UnknownTopicOrPartition
112
+ rescue Kafka::ConnectionError, Kafka::LeaderNotAvailable, Kafka::NotLeaderForPartition
113
113
  @cluster.mark_as_stale!
114
114
 
115
115
  raise
data/lib/kafka/fetcher.rb CHANGED
@@ -138,9 +138,9 @@ module Kafka
138
138
  highwater_mark_offset: batch.highwater_mark_offset,
139
139
  message_count: batch.messages.count,
140
140
  })
141
-
142
- @next_offsets[batch.topic][batch.partition] = batch.last_offset + 1
143
141
  end
142
+
143
+ @next_offsets[batch.topic][batch.partition] = batch.last_offset + 1
144
144
  end
145
145
 
146
146
  @queue << [:batches, batches]
@@ -8,13 +8,11 @@ module Kafka
8
8
  @last_heartbeat = Time.now
9
9
  end
10
10
 
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
11
+ def send_if_necessary
12
+ if Time.now > @last_heartbeat + @interval
13
+ @group.heartbeat
14
+ @last_heartbeat = Time.now
15
+ end
18
16
  end
19
17
  end
20
18
  end
data/lib/kafka/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kafka
4
- VERSION = "0.6.8"
4
+ VERSION = "0.7.0.alpha1"
5
5
  end
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.8
4
+ version: 0.7.0.alpha1
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-08-09 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -412,9 +412,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
412
412
  version: 2.1.0
413
413
  required_rubygems_version: !ruby/object:Gem::Requirement
414
414
  requirements:
415
- - - ">="
415
+ - - ">"
416
416
  - !ruby/object:Gem::Version
417
- version: '0'
417
+ version: 1.3.1
418
418
  requirements: []
419
419
  rubyforge_project:
420
420
  rubygems_version: 2.7.6