Skip to content

Add 'codec' parameter to Producer #166

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 20, 2014

Conversation

patricklucas
Copy link
Contributor

Adds a codec parameter to Producer.init that lets the user choose
a compression codec to use for all messages sent by it.

This change technically breaks backwards compatibility if a user instantiated a Producer using positional arguments instead of keyword arguments. It's up to you all how to handle this concern.

Patrick Lucas and others added 2 commits May 3, 2014 16:09
Adds a codec parameter to Producer.__init__ that lets the user choose
a compression codec to use for all messages sent by it.
Improve Tests, fix connection error timeout, other issues
@wizzat
Copy link
Collaborator

wizzat commented May 7, 2014

I'm going to work on merging this and making the CI build pass. This was literally my next task at work.

…ssion

Conflicts:
	servers/0.8.0/kafka-src
	test/test_unit.py
@patricklucas
Copy link
Contributor Author

Merged in your changes. I didn't work on any tests since I got a battery of failures when trying to run tox out of the box, but they appear to run now.

Add function kafka.protocol.create_message_set() that takes a list of
payloads and a codec and returns a message set with the desired encoding.

Introduce kafka.common.UnsupportedCodecError, raised if an unknown codec
is specified.

Include a test for the new function.
@patricklucas
Copy link
Contributor Author

I pulled the logic I added into a function in kafka.protocol and added a test. (Now that I can run tox :))

@dpkp
Copy link
Owner

dpkp commented May 12, 2014

LGTM.

@wizzat
Copy link
Collaborator

wizzat commented May 15, 2014

+1, I'd like to see this merged.

dpkp added a commit that referenced this pull request May 20, 2014
…ession

Add 'codec' parameter to Producer
@dpkp dpkp merged commit ae6b49a into dpkp:master May 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants