Skip to content

Conversation

@c19
Copy link

@c19 c19 commented Aug 27, 2015

http://kafka-python.readthedocs.org/en/latest/usage.html#keyed-messages

producer.send_messages(b'my-topic', b'key1', b'some message')
originally will two None key messages (None, 'key1') (None, 'some message')
fixed send with key would be:
producer.send_messages(b'my-topic', b'some message', key=b'key1')

@dpkp
Copy link
Owner

dpkp commented Dec 2, 2015

I think maybe the documentation is just confusing? the docstring for SimpleProducer.send_messages does say: All messages produced via this method will set the message 'key' to Null

For keyed messages you might try the KeyedProducer class.

@c19
Copy link
Author

c19 commented Dec 5, 2015

Yes, I figured it out..

@c19 c19 closed this Dec 5, 2015
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.

2 participants