Route message to any handlers on the message namespace

def _route_message(self, message, data):
        """ Route message to any handlers on the message namespace """
        # route message to handlers
        if message.namespace in self._handlers:

            # debug messages
            if message.namespace != NS_HEARTBEAT:
                self.logger.debug(
                    "[%s:%s] Received: %s", self.fn or self.host, self.port,
                    _message_to_string(message, data))

            # message handlers
            try:
                handled = \
                    self._handlers[message.namespace].receive_message(
                        message, data)

                if not handled:
                    if data.get(REQUEST_ID) not in self._request_callbacks:
                        self.logger.debug(
                            "[%s:%s] Message unhandled: %s",
                            self.fn or self.host, self.port,
                            _message_to_string(message, data))
            except Exception:  # pylint: disable=broad-except
                self.logger.exception(
                    ("[%s:%s] Exception caught while sending message to "
                     "controller %s: %s"), self.fn or self.host, self.port,
                    type(self._handlers[message.namespace]).__name__,
                    _message_to_string(message, data))

        else:
            self.logger.debug(
                "[%s:%s] Received unknown namespace: %s",
                self.fn or self.host, self.port,
                _message_to_string(message, data))