Class DelegatingDecompressingPostProcessor

java.lang.Object
org.springframework.amqp.support.postprocessor.DelegatingDecompressingPostProcessor
All Implemented Interfaces:
MessagePostProcessor, Ordered

public class DelegatingDecompressingPostProcessor extends Object implements MessagePostProcessor, Ordered
A MessagePostProcessor that delegates to one of its MessagePostProcessors depending on the content encoding. Supports gzip, zip, deflate by default.
Since:
1.4.2
Author:
Gary Russell, David Diehl, Ngoc Nhan
  • Constructor Details

    • DelegatingDecompressingPostProcessor

      public DelegatingDecompressingPostProcessor()
      Construct an instance with the default decompressors (gzip, zip, deflate) with the alwaysDecompress flag set to true.
  • Method Details

    • getOrder

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

      public void setOrder(int order)
      Set the order.
      Parameters:
      order - the order.
      See Also:
    • addDecompressor

      public void addDecompressor(String contentEncoding, MessagePostProcessor decompressor)
      Add a message post processor to the map of decompressing MessageProcessors.
      Parameters:
      contentEncoding - the content encoding; messages will be decompressed with this post processor if its content-encoding property matches, or begins with this key followed by ":".
      decompressor - the decompressing MessagePostProcessor.
    • removeDecompressor

      public MessagePostProcessor removeDecompressor(String contentEncoding)
      Remove the decompressor for this encoding; content will not be decompressed even if the MessageProperties.SPRING_AUTO_DECOMPRESS header is true.
      Parameters:
      contentEncoding - the content encoding.
      Returns:
      the decompressor if it was present.
    • setDecompressors

      public void setDecompressors(Map<String,MessagePostProcessor> decompressors)
      Replace all the decompressors.
      Parameters:
      decompressors - the decompressors.
    • postProcessMessage

      public Message postProcessMessage(Message message) throws AmqpException
      Description copied from interface: MessagePostProcessor
      Change (or replace) the message.
      Specified by:
      postProcessMessage in interface MessagePostProcessor
      Parameters:
      message - the message.
      Returns:
      the message.
      Throws:
      AmqpException - an exception.