Skip to content

Support for encoding/decoding non-string messages #210

@jakekdodd

Description

@jakekdodd

I've been trying to figure out how to send Avro-encoded messages with kafka-python. As best as I can tell, this isn't possible, since the write_int_string method called by _encode_message checks to make sure that the message is of type String, and errors out if this is not the case.

I don't see any reason why the kafka-python Producer should require that the message be a string, since Kafka messages are just bytes. Why was this design decision made, and is this something that's easily changeable to support non-string messages?

Or, am I just missing something, and this is possible with the current release of kafka-python?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions