def create_gzip_message(payloads, key=None, compresslevel=None):
message_set = KafkaProtocol._encode_message_set(<EOL>[create_message(payload, pl_key) for payload, pl_key in payloads])<EOL>gzipped = gzip_encode(message_set, compresslevel=compresslevel)<EOL>codec = ATTRIBUTE_CODEC_MASK & CODEC_GZIP<EOL>return Message(<NUM_LIT:0>, <NUM_LIT> | codec, key, gzipped)<EOL>
Construct a Gzipped Message containing multiple Messages

The given payloads will be encoded, compressed, and sent as a single atomic
message to Kafka.

Arguments:
    payloads: list(bytes), a list of payload to send be sent to Kafka
    key: bytes, a key used for partition routing (optional)