Skip to content

Commit

Permalink
Merge pull request vert-x3#107 from vert-x3/checksum-deprecated
Browse files Browse the repository at this point in the history
Added checksum deprecation on record as for the native Kafka client
  • Loading branch information
ppatierno authored Jun 14, 2018
2 parents 885b68b + 70fa116 commit 4fed6d3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import java.util.Objects;

/**
* Converter for {@link io.vertx.kafka.client.common.PartitionInfo}.
Expand Down Expand Up @@ -74,4 +75,5 @@ public static void toJson(PartitionInfo obj, java.util.Map<String, Object> json)
json.put("topic", obj.getTopic());
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ public interface KafkaConsumerRecord<K, V> {

/**
* @return the checksum (CRC32) of the record.
*
* @deprecated As of Kafka 0.11.0. Because of the potential for message format conversion on the broker, the
* checksum returned by the broker may not match what was computed by the producer.
* It is therefore unsafe to depend on this checksum for end-to-end delivery guarantees. Additionally,
* message format v2 does not include a record-level checksum (for performance, the record checksum
* was replaced with a batch checksum). To maintain compatibility, a partial checksum computed from
* the record timestamp, serialized key size, and serialized value size is returned instead, but
* this should not be depended on for end-to-end reliability.
*/
@Deprecated
long checksum();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public TimestampType timestampType() {
return this.record.timestampType();
}

@Deprecated
@Override
public long checksum() {
return this.record.checksum();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ public RecordMetadata(JsonObject json) {

/**
* @return the checksum (CRC32) of the record.
*
* @deprecated As of Kafka 0.11.0. Because of the potential for message format conversion on the broker, the
* checksum returned by the broker may not match what was computed by the producer.
* It is therefore unsafe to depend on this checksum for end-to-end delivery guarantees. Additionally,
* message format v2 does not include a record-level checksum (for performance, the record checksum
* was replaced with a batch checksum). To maintain compatibility, a partial checksum computed from
* the record timestamp, serialized key size, and serialized value size is returned instead, but
* this should not be depended on for end-to-end reliability.
*/
@Deprecated
public long checksum() {
return this.checksum;
}
Expand Down

0 comments on commit 4fed6d3

Please sign in to comment.