ruby-kafka 0.5.1.beta2 → 0.5.1
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/lib/kafka/producer.rb +2 -3
- data/lib/kafka/protocol/message.rb +5 -0
- data/lib/kafka/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d49d8b32a6bc80b5043338fe73a5bdb06e2d0718
|
4
|
+
data.tar.gz: 0d9aea1954190682562c2f4e2baa2dde3ee562cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d031ca62f99d9034f1a3671b4710138a76b57ab347adab47062275da7cc8eb303b0b8db34cc502a70384c4dcaa423a968b693d139750b9104da36e30712c3abf
|
7
|
+
data.tar.gz: 15d5145f8fbf7def123156d05976f3f8666089421b59a3f9bff5e82ea2e5a4c629a885b58f4fc59de31c2cb3dd1fa70e3c5cefbdae709a782427692237703508
|
data/CHANGELOG.md
CHANGED
@@ -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
|
|
data/lib/kafka/producer.rb
CHANGED
@@ -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
|
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.5.1
|
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-
|
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:
|
387
|
+
version: '0'
|
388
388
|
requirements: []
|
389
389
|
rubyforge_project:
|
390
390
|
rubygems_version: 2.6.13
|