private void setCompressionProperties(final OutputFactory outputStreamSupport,
                                          final HttpUriRequestBase request) {
        if (outputStreamSupport.isUseCompression()) {
            // This is the method as configured in the pipe elm. It may correspond to a different
            // value in 'Compression' and 'Content-Encoding' headers, e.g. `gz' => `gzip`.
            // Not all compressionMethods are valid as a 'Compression' or 'Content-Encoding' header value.
            final String compressionMethod = outputStreamSupport.getCompressionMethod();
            final String contentEncoding = COMPRESSION_TO_ENCODING_MAP.get(compressionMethod);
            final String stroomCompression = COMPRESSION_TO_STROOM_COMPRESSION_MAP.get(compressionMethod);
            LOGGER.debug("compressionMethod: {}, contentEncoding: {}, stroomCompression: {}",
                    compressionMethod, contentEncoding, stroomCompression);

            // We can't set both else the server may decode using Content-Encoding then stroom will
            // try to decode plain text. User can decide which header to use based on the destination
            // and what it supports.
            if (useContentEncodingHeader) {
                // use Content-Encoding if sending to a non-stroom end point as it is a HTTP standard
                // Only some of the supported compression methods are valid content-encoding values.
                if (NullSafe.isNonEmptyString(contentEncoding)) {
                    addRequestProperty(request, StandardHeaderArguments.CONTENT_ENCODING, contentEncoding);
                } else {
                    final String validCompressionMethods = keySetToSortedCsvStr(COMPRESSION_TO_ENCODING_MAP);
                    fatal("Properties useCompression and useContentEncodingHeader are both 'true', but '" +
                          compressionMethod + "' is not a valid compressionMethod for use with the '" +
                          StandardHeaderArguments.CONTENT_ENCODING + "' HTTP header. Valid " +
                          "compressionMethod values are [" + validCompressionMethods + "].");
                }
            } else {
                // use 'Compression' header for sending to a stroom(-proxy)?
                // Stroom only supports gzip/zip at the mo.
                if (NullSafe.isNonEmptyString(stroomCompression)) {
                    addRequestProperty(request, StandardHeaderArguments.COMPRESSION, stroomCompression);
                } else {
                    final String validCompressionMethods = keySetToSortedCsvStr(COMPRESSION_TO_STROOM_COMPRESSION_MAP);
                    fatal("Property useCompression is 'true' and useContentEncodingHeader is 'false', but '" +
                          compressionMethod + "' is not a valid compressionMethod for use with the '" +
                          StandardHeaderArguments.COMPRESSION + "' HTTP header. Valid " +
                          "compressionMethod values are [" + validCompressionMethods + "].");
                }
            }
        } else {
            LOGGER.debug("useCompression is false");
        }
    }
Handler class that forwards the request to a URL.
stroom-pipeline/src/main/java/stroom/pipeline/writer/HTTPAppender.java