I think it makes sense to take this reasonable precaution and check that
the entire message was parsed successfully at the server side.



On Tue, May 26, 2015 at 4:31 AM, Grant Henke <ghe...@cloudera.com> wrote:

> Bumping this message again to get some input before opening a Jira.
>
> On Thu, May 21, 2015 at 11:31 AM, Grant Henke <ghe...@cloudera.com> wrote:
>
> > When working on my own implementation of the wire protocol, via a copy
> and
> > paste error, I accidentally sent an OffsetCommit message to the
> > ConsumerMetadata api. This was clearly my mistake but what surprised me
> is
> > that I got a valid ConsumerMetadata response back with no error.
> >
> > Digging a little deeper this is because both messages expect a string in
> > the first position, so when the OffsetCommit (much larger) message is
> > parsed as a ConsumerMetadata message everything parses okay on the server
> > side. The only issue is that there are many bytes left over in the sent
> > message since OffsetCommit has many more fields following the initial
> > string.
> >
> > Knowing that this is client/dev error, I still expected Kafka to fail my
> > message based on expected message size. If Kafka parsing messages would
> be
> > strict about "left over" bytes it could catch this. Should this check be
> > implemented in the Kafka server when parsing all messages? If so I can
> open
> > a Jira.
> >
> > Thank you,
> > Grant
> >
> > --
> > Grant Henke
> > Solutions Consultant | Cloudera
> > ghe...@cloudera.com | twitter.com/ghenke <http://twitter.com/gchenke> |
> > linkedin.com/in/granthenke
> >
>
>
>
> --
> Grant Henke
> Solutions Consultant | Cloudera
> ghe...@cloudera.com | twitter.com/ghenke <http://twitter.com/gchenke> |
> linkedin.com/in/granthenke
>

Reply via email to