Generate multiple ~uamqp.message.Message objects from a single data
        stream that in total may exceed the maximum individual message size.
        Data will be continuously added to a single message until that message
        reaches a max allowable size, at which point it will be yielded and
        a new message will be started.

        :rtype: generator[~uamqp.message.Message]

def _multi_message_generator(self):
        """Generate multiple ~uamqp.message.Message objects from a single data
        stream that in total may exceed the maximum individual message size.
        Data will be continuously added to a single message until that message
        reaches a max allowable size, at which point it will be yielded and
        a new message will be started.

        :rtype: generator[~uamqp.message.Message]
        """
        unappended_message_bytes = None
        while True:
            new_message = self._create_batch_message()
            message_size = new_message.get_message_encoded_size() + self.size_offset
            body_size = 0
            if unappended_message_bytes:
                new_message._body.append(unappended_message_bytes)  # pylint: disable=protected-access
                body_size += len(unappended_message_bytes)
            try:
                for data in self._body_gen:
                    message_bytes = None
                    try:
                        if not data.application_properties:  # Message-like object
                            data.application_properties = self.application_properties
                        message_bytes = data.encode_message()
                    except AttributeError:  # raw data
                        wrap_message = Message(body=data, application_properties=self.application_properties)
                        message_bytes = wrap_message.encode_message()
                    body_size += len(message_bytes)
                    if (body_size + message_size) > self.max_message_length:
                        new_message.on_send_complete = self.on_send_complete
                        unappended_message_bytes = message_bytes
                        yield new_message
                        raise StopIteration()
                    new_message._body.append(message_bytes)  # pylint: disable=protected-access
            except StopIteration:
                _logger.debug("Sent partial message.")
                continue
            else:
                new_message.on_send_complete = self.on_send_complete
                yield new_message
                _logger.debug("Sent all batched data.")
                break