Jason Rosenberg 2013-08-23, 23:10
Jun Rao 2013-08-24, 04:08
Vadim Keylis 2013-08-24, 04:41
Neha Narkhede 2013-08-24, 05:48
Jason Rosenberg 2013-08-24, 08:44
Jun Rao 2013-08-24, 15:22
Jason Rosenberg 2013-08-24, 16:54
Neha Narkhede 2013-08-24, 17:06
On Sat, Aug 24, 2013 at 10:06 AM, Neha Narkhede <[EMAIL PROTECTED]>wrote:
> >> I gathered from one of your previous responses, that a
> can be rectified with a smaller batch size.
> If so, does that imply that the message size limit is measured on the
> broker by the cumulative size of the batch, and not of any one message?
> That's right. The broker does the message size check on the compressed
> message. The size of the compressed message
> is proportional to the batch size. Hence, reducing the batch size on a
> retry might make sense here, but currently the
> producer doesn't do this.
Ok, but perhaps the producer will handle something like this in the future?
> >> If I want to implement guaranteed delivery semantics, using the new
> configuration, I need to expose retry logic beyond
> that built into the producer?
> The kafka producer must handle recoverable exceptions with a configurable
> number of retries and must not retry
> on unrecoverable exceptions. So ideally you shouldn't have to write your
> own batching and retry logic.
So, it seems there might be a bit of a gray area. There is a configurable
retry count, which we can increase perhaps to gain confidence that anything
recoverable has been sent. But, since this retry count is finite, there's
no way to know for sure that it won't succeed if it were retried just one
more time. So, it is then difficult to conclude that if Producer.send
throws a FailedToSendMessageException, the message shouldn't be retried.
Perhaps it would be useful to define different exception types, so that a
caller can have clearer semantics:
UnretryableFailedToSendMessageException (wraps the root cause)
NoMoreRetriesFailedToSendMessageException (wraps the root cause, from the
Probably shorter names are possible here! Perhaps these could be
subclasses of FailedToSendMessageException. Alternately,
FailedToSendMessageException could include information, such as the number
of retries attempted, and a flag indicating whether it's possible to retry
> On Sat, Aug 24, 2013 at 9:54 AM, Jason Rosenberg <[EMAIL PROTECTED]> wrote:
> > Jun,
> > Thanks, this is helpful.
> > So, can QueueFullException occur in either sync or async mode (or just
> > async mode)?
> > If there's a MessageSizeTooLargeException, is there any visibility of
> > to the caller? Or will it just be a FailedToSendMessageException. I
> > gathered from one of your previous responses, that a
> > MessageSizeTooLargeException can be rectified with a smaller batch size.
> > If so, does that imply that the message size limit is measured on the
> > broker by the cumulative size of the batch, and not of any one message?
> > (makes sense if the broker doesn't unwrap a batch of messages before
> > storing on the server).
> > If I want to implement guaranteed delivery semantics, using the new
> > request.required.acks configuration, I need to expose retry logic beyond
> > that built into the producer? And to do this, I need to indicate to the
> > caller whether it's possible to retry, or whether it will be fruitless.
> > suppose allowing message.max.send.retries to allow infinite retries (e.g.
> > by setting it to -1) might be useful. But optionally, I'd like the
> > to be able to handle this retry logic itself.
> > Jason
> > On Sat, Aug 24, 2013 at 8:22 AM, Jun Rao <[EMAIL PROTECTED]> wrote:
> > > You don't need to restart the producer. The producer currently handles
> > all
> > > error/exceptions by refreshing the metadata and retrying. If it fails
> > > retries, it throws a FailedToSendMessageException to the caller (in
> > > mode). The original cause is not included in this exception. We have
> > > thought about being a bit smarter in the producer retry logic such that
> > it
> > > only retries on recoverable errors and could implement this at some
Neha Narkhede 2013-08-25, 03:26
Guozhang Wang 2013-08-26, 05:01
Jason Rosenberg 2013-08-26, 07:21