@Override public void sendResponse(Exchange exchange, Response response) { if (response.getDestination() == null) throw new NullPointerException("Response has no destination address"); if (response.getDestinationPort() == 0) throw new NullPointerException("Response has no destination port"); matcher.sendResponse(exchange, response); /* * Logging here causes significant performance loss. * If necessary, add an interceptor that logs the messages, * e.g., the MessageTracer. */ for (MessageInterceptor interceptor:interceptors) interceptor.sendResponse(response); // MessageInterceptor might have canceled if (response.isCanceled()) { if (null != exchange) { exchange.setComplete(); } } else { connector.send(serializer.serialize(response)); } }
@Override public void sendResponse(Exchange exchange, Response response) { assertMessageHasDestinationAddress(response); matcher.sendResponse(exchange, response); /* * Logging here causes significant performance loss. * If necessary, add an interceptor that logs the messages, * e.g., the MessageTracer. */ for (MessageInterceptor interceptor:interceptors) { interceptor.sendResponse(response); } // MessageInterceptor might have canceled if (response.isCanceled()) { if (null != exchange) { exchange.setComplete(); } } else { connector.send(serializer.serializeResponse(response)); } }