We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b5b3c55 + c3951ea commit e0da111Copy full SHA for e0da111
lib/kafka/protocol/message.rb
@@ -89,6 +89,11 @@ def self.decode(decoder)
89
timestamp = nil
90
when 1
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?
97
else
98
raise Kafka::Error, "Invalid magic byte: #{magic_byte}"
99
end
0 commit comments