Class DelegatingDecompressingPostProcessor
- java.lang.Object
-
- org.springframework.amqp.support.postprocessor.DelegatingDecompressingPostProcessor
-
- All Implemented Interfaces:
MessagePostProcessor,org.springframework.core.Ordered
public class DelegatingDecompressingPostProcessor extends java.lang.Object implements MessagePostProcessor, org.springframework.core.Ordered
AMessagePostProcessorthat delegates to one of itsMessagePostProcessors depending on the content encoding. Supportsgzip, zip, deflateby default.- Since:
- 1.4.2
-
-
Constructor Summary
Constructors Constructor Description DelegatingDecompressingPostProcessor()Construct an instance with the default decompressors (gzip, zip, deflate) with the alwaysDecompress flag set to true.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDecompressor(java.lang.String contentEncoding, MessagePostProcessor decompressor)Add a message post processor to the map of decompressing MessageProcessors.intgetOrder()MessagepostProcessMessage(Message message)Change (or replace) the message.MessagePostProcessorremoveDecompressor(java.lang.String contentEncoding)Remove the decompressor for this encoding; content will not be decompressed even if theMessageProperties.SPRING_AUTO_DECOMPRESSheader is true.voidsetDecompressors(java.util.Map<java.lang.String,MessagePostProcessor> decompressors)Replace all the decompressors.voidsetOrder(int order)Set the order.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.amqp.core.MessagePostProcessor
postProcessMessage, postProcessMessage
-
-
-
-
Method Detail
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
Set the order.- Parameters:
order- the order.- See Also:
Ordered
-
addDecompressor
public void addDecompressor(java.lang.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 itscontent-encodingproperty matches, or begins with this key followed by ":".decompressor- the decompressingMessagePostProcessor.
-
removeDecompressor
public MessagePostProcessor removeDecompressor(java.lang.String contentEncoding)
Remove the decompressor for this encoding; content will not be decompressed even if theMessageProperties.SPRING_AUTO_DECOMPRESSheader is true.- Parameters:
contentEncoding- the content encoding.- Returns:
- the decompressor if it was present.
-
setDecompressors
public void setDecompressors(java.util.Map<java.lang.String,MessagePostProcessor> decompressors)
Replace all the decompressors.- Parameters:
decompressors- the decompressors.
-
postProcessMessage
public Message postProcessMessage(Message message) throws AmqpException
Description copied from interface:MessagePostProcessorChange (or replace) the message.- Specified by:
postProcessMessagein interfaceMessagePostProcessor- Parameters:
message- the message.- Returns:
- the message.
- Throws:
AmqpException- an exception.
-
-