private void doHandle(final HttpServletRequest request, final HttpServletResponse response) {
        try {
            final Instant receiveTime = Instant.now();

            // Create a new proxy id for the request, so we can track progress of the stream
            // through the various proxies and into stroom and report back the ID to the sender,
            final UniqueId receiptId = receiptIdGenerator.generateId();

            // Create attribute map from headers.
            final AttributeMap attributeMap = AttributeMapUtil.create(
                    request,
                    certificateExtractor,
                    receiveTime,
                    receiptId);

            LOGGER.debug(() -> LogUtil.message(
                    "handle() - requestUri: {}, remoteHost/Addr: {}, attributeMap: {}, ",
                    request.getRequestURI(),
                    Objects.requireNonNullElseGet(
                            request.getRemoteHost(),
                            request::getRemoteAddr),
                    attributeMap));

            // Authorise request.
            requestAuthenticator.authenticate(request, attributeMap);

            // Treat differently depending on compression type.
            final String compression = AttributeMapUtil.validateAndNormaliseCompression(
                    attributeMap,
                    compressionVal -> new StroomStreamException(
                            StroomStatusCode.UNKNOWN_COMPRESSION, attributeMap, compressionVal));

            final Receiver receiver;
            final String contentLength = attributeMap.get(StandardHeaderArguments.CONTENT_LENGTH);
            dataReceiptMetrics.recordContentLength(contentLength);
            if (ZERO_CONTENT.equals(contentLength)) {
                LOGGER.warn("process() - Skipping Zero Content " + attributeMap);
                receiver = null;
            } else {
                receiver = receiverFactory.get(attributeMap);
                receiver.receive(
                        receiveTime,
                        attributeMap,
                        request.getRequestURI(),
                        request::getInputStream);
            }

            response.setStatus(HttpStatus.SC_OK);

            LOGGER.debug(() -> LogUtil.message(
                    "Writing proxy receipt id {} to response. Receiver: {}, duration: {}, compression: '{}'",
                    receiptId,
                    NullSafe.get(receiver, Object::getClass, Class::getSimpleName),
                    Duration.between(receiveTime, Instant.now()),
                    compression));
            try (final PrintWriter writer = response.getWriter()) {
                writer.println(receiptId);
            } catch (final IOException e) {
                LOGGER.error(e.getMessage(), e);
            }
        } catch (final StroomStreamException e) {
            e.sendErrorResponse(response);
        }
    }
Main entry point to handling proxy requests.
<p>
This class used the main context and forwards the request on to our
dynamic mini proxy.
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/ProxyRequestHandler.java