kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Kreps (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-496) high level producer send should return a response
Date Thu, 06 Sep 2012 17:33:08 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449842#comment-13449842
] 

Jay Kreps commented on KAFKA-496:
---------------------------------

A more concrete description would be that we return a ProduceResponse which has an offset
and error. Calls to 
  response.offset() or response.error()
would block until the request completed in the case of an async request. We would probably
also need 
  response.onComplete(fun)
to register a callback that would be run when the response was done.

One question, though, is whether an error should result in an exception or in an error code
when you try to get either field.

The advantage of this is that the semantics of produce would remain the same for both sync
and async. Code written to work with sync could be changed to async with only a config change.

It would be worth thinking through if there is a use case for this because it is likely a
bit more complicated.
                
> high level producer send should return a response
> -------------------------------------------------
>
>                 Key: KAFKA-496
>                 URL: https://issues.apache.org/jira/browse/KAFKA-496
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>            Reporter: Jun Rao
>              Labels: features
>             Fix For: 0.8
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> Currently, Producer.send() doesn't return any value. In 0.8, since each produce request
will be acked, we should pass the response back. What we can do is that if the producer is
in sync mode, we can return a map of (topic,partitionId) -> (errorcode, offset). If the
producer is in async mode, we can just return a null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message