code: def _encode_message_header(cls, client_id, correlation_id, request_key,
                                 api_version=0):
          
          return (struct.pack('>hhih',
                              request_key,          # ApiKey
                              api_version,          # ApiVersion
                              correlation_id,       # CorrelationId
                              len(client_id)) +     # ClientId size
                  client_id)
docs: Encode the common request envelope