Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support messages with magic version 1 #9

Merged
merged 2 commits into from Aug 8, 2012

Conversation

Projects
None yet
2 participants
Contributor

ept commented Aug 8, 2012

The message parser currently assumes that messages always have the magic byte set to 0. However, the Java producer of Kafka 0.7.0 generates messages with magic == 1.

Currently, the parser doesn't even check the value of the magic byte, and just assumes the version 0 format. Thus the message is parsed incorrectly (the last byte of the CRC32 is added as the first byte of the payload, and the CRC32 doesn't match).

This patch adds basic support for version 1. It doesn't yet interpret the value of the attributes byte (that would be a useful addition for the future).

acrosa added a commit that referenced this pull request Aug 8, 2012

Merge pull request #9 from ept/magic-version-1
Support messages with magic version 1

@acrosa acrosa merged commit a4a78f4 into acrosa:master Aug 8, 2012

Owner

acrosa commented Aug 8, 2012

Thanks Martin, looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment