Class AbstractCompressingPostProcessor

    • Field Detail

      • logger

        protected final Log logger
    • Constructor Detail

      • AbstractCompressingPostProcessor

        public AbstractCompressingPostProcessor​(boolean autoDecompress)
        Construct a post processor that will include (or not include) the MessageProperties.SPRING_AUTO_DECOMPRESS header. Used by the (Spring AMQP) inbound message converter to determine whether the message should be decompressed automatically, or remain compressed.
        Parameters:
        autoDecompress - true to indicate the receiver should automatically decompress.
    • Method Detail

      • setCopyProperties

        public void setCopyProperties​(boolean copyProperties)
        Flag to indicate if MessageProperties should be used as is or cloned for new message after compression. By default this flag is turned off for better performance since in most cases the original message is not used any more.
        Parameters:
        copyProperties - clone or reuse original message properties.
        Since:
        2.1.5
      • setEncodingDelimiter

        public void setEncodingDelimiter​(String encodingDelimiter)
        Set a delimiter to be added between the compression type and the original encoding, if any. Defaults to ", " (since 2.3); for compatibility with consumers using versions of spring-amqp earlier than 2.2.12, set it to ":" (no trailing space).
        Parameters:
        encodingDelimiter - the delimiter.
        Since:
        2.2.12
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface Ordered
      • setOrder

        protected void setOrder​(int order)
        Set the order.
        Parameters:
        order - the order, default 0.
        See Also:
        Ordered
      • getCompressorStream

        protected abstract OutputStream getCompressorStream​(OutputStream stream)
                                                     throws IOException
        Get the stream.
        Parameters:
        stream - The output stream to write the compressed data to.
        Returns:
        the compressor output stream.
        Throws:
        IOException - IOException
      • getEncoding

        protected abstract String getEncoding()
        Get the encoding.
        Returns:
        the content-encoding header.