ruby-kafka 0.7.1.messagecorruptiondebug → 0.7.1.possible.pre.fetch.pre.fix

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a11d6e742f0e2599fe196d4606b827ea740baf519759486f002733061a5a90a
4
- data.tar.gz: 3f553bcf7b87580f9db60c2965b734e511b9a1e90197d9144f26d8d5054cdd61
3
+ metadata.gz: 15856fc831de82f3aeacd6ad834deb9a4ecd557f44ee3569601e4c587a5d2926
4
+ data.tar.gz: 7a715d38c914fa465166377ce780523db8484c4c9f72b13d4127be435e50fa7d
5
5
  SHA512:
6
- metadata.gz: 4f92c802af4eb9387cb9a21bbcb2da97521d724b577a7ce930d0c1e4ed732511bce76189024e37bdad94b97ef50306874d83a969a4980ca2b0d08295c4eb1924
7
- data.tar.gz: 7de9e95cb0dc164e1aabc87de0ab6ea00eef6db06b5484c8f6fa3e55b7fc26053138193d1fe3625992a864a247ae4869f9de724db33eabf440948e117a0e300a
6
+ metadata.gz: adc8350cf6c9dc5ee7390e5df7baecaaf62b607295592e68ca0440d86c0032d07bb9e36031b691784f967bd16191dbd366b8f008b58aadd3c8e2d4604950b330
7
+ data.tar.gz: fb86ae6fcb3bf1d729919c6f172d033f00fce855e349360fb95d934b13e9e0acf0d5cdc58813c57d80b5467f89c3d744f93fb87ab8c49d5e27ec11bee074ff87
data/CHANGELOG.md CHANGED
@@ -4,11 +4,10 @@ Changes and additions to the library will be listed here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ - Fix consuming duplication due to redundant messages returned from Kafka (#636).
8
+
7
9
  ## 0.7.1
8
10
 
9
- - Compatibility with dogstatsd-ruby v4.0.0.
10
- - Fix consuming duplication due to redundant messages returned from Kafka (#636).
11
- - Fresh cluster info on fetch error (#641).
12
11
  - Exactly Once Delivery and Transactional Messaging Support (#608).
13
12
  - Support extra client certificates in the SSL Context when authenticating with Kafka (#633).
14
13
 
data/lib/kafka/broker.rb CHANGED
@@ -71,25 +71,7 @@ module Kafka
71
71
  def produce(**options)
72
72
  request = Protocol::ProduceRequest.new(**options)
73
73
 
74
- resp = send_request(request)
75
-
76
- return if resp.nil?
77
-
78
- if (_topic_info, partition_info = resp.each_partition.find {|topic_info, part_info| part_info.error_code == 2 })
79
-
80
- @logger.error "Corrupt message code received for #{request} to partition #{partition_info.partition}"
81
-
82
- #{"topic" => {"partition" => [message, message] }}
83
- request.messages_for_topics.each do |topic, messages_for_partition|
84
- messages_for_partition.fetch(partition_info.partition, []).each do |message|
85
- @logger.error "Message key: #{message.key}"
86
- @logger.error "Message value: #{message.value}"
87
- end
88
- end
89
-
90
- end
91
-
92
- resp
74
+ send_request(request)
93
75
  end
94
76
 
95
77
  def fetch_offsets(**options)
data/lib/kafka/client.rb CHANGED
@@ -618,15 +618,7 @@ module Kafka
618
618
  #
619
619
  # @return [Array<String>] the list of topic names.
620
620
  def topics
621
- attempts = 0
622
- begin
623
- attempts += 1
624
- @cluster.list_topics
625
- rescue Kafka::ConnectionError
626
- @cluster.mark_as_stale!
627
- retry unless attempts > 1
628
- raise
629
- end
621
+ @cluster.list_topics
630
622
  end
631
623
 
632
624
  # Lists all consumer groups in the cluster
data/lib/kafka/cluster.rb CHANGED
@@ -397,7 +397,6 @@ module Kafka
397
397
  end
398
398
 
399
399
  def random_broker
400
- refresh_metadata_if_necessary!
401
400
  node_id = cluster_info.brokers.sample.node_id
402
401
  connect_to_broker(node_id)
403
402
  end
data/lib/kafka/datadog.rb CHANGED
@@ -40,7 +40,7 @@ module Kafka
40
40
  end
41
41
 
42
42
  def host
43
- @host ||= default_host
43
+ @host ||= ::Datadog::Statsd::DEFAULT_HOST
44
44
  end
45
45
 
46
46
  def host=(host)
@@ -49,7 +49,7 @@ module Kafka
49
49
  end
50
50
 
51
51
  def port
52
- @port ||= default_port
52
+ @port ||= ::Datadog::Statsd::DEFAULT_PORT
53
53
  end
54
54
 
55
55
  def port=(port)
@@ -77,14 +77,6 @@ module Kafka
77
77
 
78
78
  private
79
79
 
80
- def default_host
81
- ::Datadog::Statsd.const_defined?(:Connection) ? ::Datadog::Statsd::Connection::DEFAULT_HOST : ::Datadog::Statsd::DEFAULT_HOST
82
- end
83
-
84
- def default_port
85
- ::Datadog::Statsd.const_defined?(:Connection) ? ::Datadog::Statsd::Connection::DEFAULT_PORT : ::Datadog::Statsd::DEFAULT_PORT
86
- end
87
-
88
80
  def clear
89
81
  @statsd && @statsd.close
90
82
  @statsd = nil
data/lib/kafka/fetcher.rb CHANGED
@@ -185,7 +185,7 @@ module Kafka
185
185
  @cluster.refresh_metadata!
186
186
 
187
187
  # Don't overwhelm the brokers in case this keeps happening.
188
- sleep 10
188
+ sleep 1
189
189
 
190
190
  retry
191
191
  rescue NoPartitionsToFetchFrom
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.7.1.messagecorruptiondebug"
4
+ VERSION = "0.7.1.possible-fetch-fix"
5
5
  end
data/ruby-kafka.gemspec CHANGED
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "extlz4"
42
42
  spec.add_development_dependency "colored"
43
43
  spec.add_development_dependency "rspec_junit_formatter", "0.2.2"
44
- spec.add_development_dependency "dogstatsd-ruby", ">= 3.0.0", "< 5.0.0"
44
+ spec.add_development_dependency "dogstatsd-ruby", ">= 3.0.0", "<4.0.0"
45
45
  spec.add_development_dependency "statsd-ruby"
46
46
  spec.add_development_dependency "ruby-prof"
47
47
  spec.add_development_dependency "timecop"
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.7.1.messagecorruptiondebug
4
+ version: 0.7.1.possible.pre.fetch.pre.fix
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-09-20 00:00:00.000000000 Z
11
+ date: 2018-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: digest-crc
@@ -201,7 +201,7 @@ dependencies:
201
201
  version: 3.0.0
202
202
  - - "<"
203
203
  - !ruby/object:Gem::Version
204
- version: 5.0.0
204
+ version: 4.0.0
205
205
  type: :development
206
206
  prerelease: false
207
207
  version_requirements: !ruby/object:Gem::Requirement
@@ -211,7 +211,7 @@ dependencies:
211
211
  version: 3.0.0
212
212
  - - "<"
213
213
  - !ruby/object:Gem::Version
214
- version: 5.0.0
214
+ version: 4.0.0
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: statsd-ruby
217
217
  requirement: !ruby/object:Gem::Requirement