[
https://issues.apache.org/jira/browse/KAFKA-3303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15181383#comment-15181383
]
ASF GitHub Bot commented on KAFKA-3303:
---------------------------------------
GitHub user apovzner opened a pull request:
https://github.com/apache/kafka/pull/1015
KAFKA-3303: Pass partial record metadata to
ProducerInterceptor.onAcknowledgement on error
This is a KIP-42 followup.
Currently, If sending the record fails before it gets to the server,
ProducerInterceptor.onAcknowledgement() is called with metadata == null, and
non-null exception. However, it is useful to pass topic and partition, if
known, to ProducerInterceptor.onAcknowledgement() as well. This patch ensures
that ProducerInterceptor.onAcknowledgement() gets record metadata with topic
and maybe partition. If partition is not set in 'record' and
KafkaProducer.send() fails before partition gets assigned, then
ProducerInterceptor.onAcknowledgement() gets RecordMetadata with partition ==
-1. Only time when ProducerInterceptor.onAcknowledgement() gets null record
metadata is when the client passes null record to KafkaProducer.send().
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apovzner/kafka kip42-3
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/1015.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1015
----
commit 169085a6b502d9458f477030cd6045f20b0100a7
Author: Anna Povzner <[email protected]>
Date: 2016-03-05T01:05:56Z
KAFKA-3303: Pass partial record metadata to Interceptor onAcknowledgement
in case of errors
----
> Pass partial record metadata to Interceptor onAcknowledgement in case of
> errors
> -------------------------------------------------------------------------------
>
> Key: KAFKA-3303
> URL: https://issues.apache.org/jira/browse/KAFKA-3303
> Project: Kafka
> Issue Type: Improvement
> Affects Versions: 0.10.0.0
> Reporter: Anna Povzner
> Assignee: Anna Povzner
> Priority: Blocker
> Fix For: 0.10.0.0
>
>
> Currently Interceptor.onAcknowledgement behaves similarly to Callback. If
> exception occurred and exception is passed to onAcknowledgement, metadata
> param is set to null.
> However, it would be useful to pass topic, and partition if available to the
> interceptor so that it knows which topic/partition got an error.
> This is part of KIP-42.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)