def handle_client_message(self, message):
        correlation_id = message.get_correlation_id()

        start_frame = message.start_frame
        if start_frame.has_event_flag() or start_frame.has_backup_event_flag():
            self._listener_service.handle_client_message(
                message, correlation_id)
            return

        invocation = self._pending.get(correlation_id, None)
        if not invocation:
            _logger.warning("Got message with unknown correlation id: %s",
                            message)
            return

        if message.get_message_type() == EXCEPTION_MESSAGE_TYPE:
            error = create_error_from_message(message)
            return self._notify_error(invocation, error)

        self._notify(invocation, message)
Beispiel #2
0
    def handle_client_message(self, message):
        correlation_id = message.get_correlation_id()

        if message.start_frame.has_event_flag():
            self._listener_service.handle_client_message(
                message, correlation_id)
            return

        invocation = self._pending.pop(correlation_id, None)
        if not invocation:
            self.logger.warning("Got message with unknown correlation id: %s",
                                message,
                                extra=self._logger_extras)
            return

        if message.get_message_type() == EXCEPTION_MESSAGE_TYPE:
            error = create_error_from_message(message)
            return self._handle_exception(invocation, error)

        invocation.set_response(message)