def _republish(self, id):
    '\n        Check if message was delivered and republish if not\n\n        :param id: Message ID\n        '
    logging.info('_publish for {0} started'.format(id))
    time.sleep(10)
    while (id in self.__sent_messages.keys()):
        try:
            logging.info("Message {0} wasn't delivered".format(id))
            message = self.__sent_messages[id]
            self.__connection.publish(message[self._SENDER], message[self._DESTINATION], ((b'\x01' + id.to_bytes(2, 'big')) + message[self._MESSAGE]))
            time.sleep(5)
        except KeyError:
            logging.error('Message was already deleted from republish')
            break
    logging.info('Message {0} was delivered'.format(id))
Check if message was delivered and republish if not

:param id: Message ID
def _republish(self, id):
    '\n        Check if message was delivered and republish if not\n\n        :param id: Message ID\n        '
    logging.info('_publish for {0} started'.format(id))
    time.sleep(10)
    while (id in self.__sent_messages.keys()):
        try:
            logging.info("Message {0} wasn't delivered".format(id))
            message = self.__sent_messages[id]
            self.__connection.publish(message[self._SENDER], message[self._DESTINATION], ((b'\x01' + id.to_bytes(2, 'big')) + message[self._MESSAGE]))
            time.sleep(5)
        except KeyError:
            logging.error('Message was already deleted from republish')
            break
    logging.info('Message {0} was delivered'.format(id))