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