You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Mariam John (JIRA)" <ji...@apache.org> on 2018/01/21 07:07:02 UTC
[jira] [Resolved] (KAFKA-4370) CorruptRecordException when
ProducerRecord constructed without key nor partition and send
[ https://issues.apache.org/jira/browse/KAFKA-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mariam John resolved KAFKA-4370.
--------------------------------
Resolution: Duplicate
Fix Version/s: 1.0.0
This is already fixed in [https://github.com/apache/kafka/pull/3541.] I couldn't find a bug for the fix that already went in.
> CorruptRecordException when ProducerRecord constructed without key nor partition and send
> -----------------------------------------------------------------------------------------
>
> Key: KAFKA-4370
> URL: https://issues.apache.org/jira/browse/KAFKA-4370
> Project: Kafka
> Issue Type: Bug
> Components: clients
> Affects Versions: 0.10.1.0
> Reporter: Lars Pfannenschmidt
> Assignee: Mariam John
> Priority: Trivial
> Fix For: 1.0.0
>
>
> According to the JavaDoc of ProducerRecord it should be possible to send messages without a key:
> {quote}
> If neither key nor partition is present a partition will be assigned in a round-robin fashion.
> {quote}
> {code:title=SomeProducer.java|borderStyle=solid}
> ProducerRecord<String, String> record = new ProducerRecord<>(topic, "somemessage");
> return this.producer.send(record).get();
> {code}
> Unfortunately an Exception is thrown:
> {code}
> java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.CorruptRecordException: This message has failed its CRC checksum, exceeds the valid size, or is otherwise corrupt.
> at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(FutureRecordMetadata.java:65)
> at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:52)
> at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:25)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)