diff options
Diffstat (limited to 'kafka/protocol/message.py')
-rw-r--r-- | kafka/protocol/message.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kafka/protocol/message.py b/kafka/protocol/message.py index f893912..430ecad 100644 --- a/kafka/protocol/message.py +++ b/kafka/protocol/message.py @@ -22,6 +22,8 @@ class Message(Struct): CODEC_SNAPPY = 0x02 def __init__(self, value, key=None, magic=0, attributes=0, crc=0): + assert isinstance(value, bytes), 'value must be bytes' + assert key is None or isinstance(key, bytes), 'key must be bytes' self.crc = crc self.magic = magic self.attributes = attributes |