ruby-kafka 0.5.1.beta2 → 0.5.1

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
  SHA1:
3
- metadata.gz: aee148ccfa605884f691d00ae8c82432a6d6bca1
4
- data.tar.gz: 86f831463bc276e54a72d67e64aff5847ea41ec7
3
+ metadata.gz: d49d8b32a6bc80b5043338fe73a5bdb06e2d0718
4
+ data.tar.gz: 0d9aea1954190682562c2f4e2baa2dde3ee562cd
5
5
  SHA512:
6
- metadata.gz: d28036dc879a07b3580db2cece96241b5002dca3bff5e7de109cbe699e15e893a4e1ddd13283ead236a5eca9e9b25db1e0bd7de02d5e4f8c5ace24e148c89c10
7
- data.tar.gz: f3c969dfcd6cb2dca36a98a1cd80cfd20f63780e9b762fe96d6f8b39ee98ad376d8b7e641f97d5d15a647b2d63688168ec84636386d302ccbbcfbb00d1f4b093
6
+ metadata.gz: d031ca62f99d9034f1a3671b4710138a76b57ab347adab47062275da7cc8eb303b0b8db34cc502a70384c4dcaa423a968b693d139750b9104da36e30712c3abf
7
+ data.tar.gz: 15d5145f8fbf7def123156d05976f3f8666089421b59a3f9bff5e82ea2e5a4c629a885b58f4fc59de31c2cb3dd1fa70e3c5cefbdae709a782427692237703508
@@ -4,6 +4,8 @@ Changes and additions to the library will be listed here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## v0.5.1
8
+
7
9
  Requires Kafka 0.10.1+ due to usage of a few new APIs.
8
10
 
9
11
  - Fix bug when using compression (#458).
@@ -12,6 +14,7 @@ Requires Kafka 0.10.1+ due to usage of a few new APIs.
12
14
  - Add support for SASL SCRAM authentication (#465).
13
15
  - Refactor and simplify SASL code.
14
16
  - Fix issue when a consumer resets a partition to its default offset.
17
+ - Allow specifying a create time for messages (#481).
15
18
 
16
19
  ## v0.5.0
17
20
 
@@ -178,12 +178,11 @@ module Kafka
178
178
  # @param topic [String] the topic that the message should be written to.
179
179
  # @param partition [Integer] the partition that the message should be written to.
180
180
  # @param partition_key [String] the key that should be used to assign a partition.
181
+ # @param create_time [Time] the timestamp that should be set on the message.
181
182
  #
182
183
  # @raise [BufferOverflow] if the maximum buffer size has been reached.
183
184
  # @return [nil]
184
- def produce(value, key: nil, topic:, partition: nil, partition_key: nil)
185
- create_time = Time.now
186
-
185
+ def produce(value, key: nil, topic:, partition: nil, partition_key: nil, create_time: Time.now)
187
186
  message = PendingMessage.new(
188
187
  value && value.to_s,
189
188
  key && key.to_s,
@@ -89,6 +89,11 @@ module Kafka
89
89
  timestamp = nil
90
90
  when 1
91
91
  timestamp = message_decoder.int64
92
+
93
+ # If the timestamp is set to zero, it's because the message has been upgraded
94
+ # from the Kafka 0.9 disk format to the Kafka 0.10 format. The former didn't
95
+ # have a timestamp attribute, so we'll just set the timestamp to nil.
96
+ timestamp = nil if timestamp.zero?
92
97
  else
93
98
  raise Kafka::Error, "Invalid magic byte: #{magic_byte}"
94
99
  end
@@ -1,3 +1,3 @@
1
1
  module Kafka
2
- VERSION = "0.5.1.beta2"
2
+ VERSION = "0.5.1"
3
3
  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.5.1.beta2
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-10 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -382,9 +382,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
382
382
  version: 2.1.0
383
383
  required_rubygems_version: !ruby/object:Gem::Requirement
384
384
  requirements:
385
- - - ">"
385
+ - - ">="
386
386
  - !ruby/object:Gem::Version
387
- version: 1.3.1
387
+ version: '0'
388
388
  requirements: []
389
389
  rubyforge_project:
390
390
  rubygems_version: 2.6.13