You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Jay Kreps <ja...@gmail.com> on 2012/09/14 18:55:01 UTC

InvalidMessageException vs InvalidMessageSizeException vs MessageSizeTooLargeException

This seems a bit duplicative. What if we removed
MessageSizeTooLargeException and used the existing
InvalidMessageSizeException instead--no need for both. I would also like to
make InvalidMessageSizeException subclass InvalidMessageException. Thoughts?

-Jay

Re: InvalidMessageException vs InvalidMessageSizeException vs MessageSizeTooLargeException

Posted by Jay Kreps <ja...@gmail.com>.
Makes sense, I will leave it for now.

-Jay

On Fri, Sep 14, 2012 at 10:14 AM, Jun Rao <ju...@gmail.com> wrote:

> The current semantics of those exceptions are:
> InvalidMessageException: message is corrupted (crc doesn't match payload)
> InvalidMessageSizeException: message size is larger than the payload size.
> This is mostly used on the consumer side in case we fetch a chunk of bytes
> on a wrong starting offset.
> MessageSizeTooLargeException: If a producer sends a valid message whose
> payload is larger than a configured size.
>
> So, they really have different meanings (yes, the difference is small and
> subtle).
>
> Thanks,
>
> Jun
>
>
> On Fri, Sep 14, 2012 at 9:55 AM, Jay Kreps <ja...@gmail.com> wrote:
>
> > This seems a bit duplicative. What if we removed
> > MessageSizeTooLargeException and used the existing
> > InvalidMessageSizeException instead--no need for both. I would also like
> to
> > make InvalidMessageSizeException subclass InvalidMessageException.
> > Thoughts?
> >
> > -Jay
> >
>

Re: InvalidMessageException vs InvalidMessageSizeException vs MessageSizeTooLargeException

Posted by Jun Rao <ju...@gmail.com>.
The current semantics of those exceptions are:
InvalidMessageException: message is corrupted (crc doesn't match payload)
InvalidMessageSizeException: message size is larger than the payload size.
This is mostly used on the consumer side in case we fetch a chunk of bytes
on a wrong starting offset.
MessageSizeTooLargeException: If a producer sends a valid message whose
payload is larger than a configured size.

So, they really have different meanings (yes, the difference is small and
subtle).

Thanks,

Jun


On Fri, Sep 14, 2012 at 9:55 AM, Jay Kreps <ja...@gmail.com> wrote:

> This seems a bit duplicative. What if we removed
> MessageSizeTooLargeException and used the existing
> InvalidMessageSizeException instead--no need for both. I would also like to
> make InvalidMessageSizeException subclass InvalidMessageException.
> Thoughts?
>
> -Jay
>