Class DelegatingDecompressingPostProcessor
- java.lang.Object
-
- org.springframework.amqp.support.postprocessor.DelegatingDecompressingPostProcessor
-
- All Implemented Interfaces:
MessagePostProcessor
,Ordered
public class DelegatingDecompressingPostProcessor extends Object implements MessagePostProcessor, Ordered
AMessagePostProcessor
that delegates to one of itsMessagePostProcessor
s depending on the content encoding. Supportsgzip, zip, deflate
by default.- Since:
- 1.4.2
- Author:
- Gary Russell, David Diehl
-
-
Field Summary
-
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
-
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 void
addDecompressor(String contentEncoding, MessagePostProcessor decompressor)
Add a message post processor to the map of decompressing MessageProcessors.int
getOrder()
Message
postProcessMessage(Message message)
Change (or replace) the message.MessagePostProcessor
removeDecompressor(String contentEncoding)
Remove the decompressor for this encoding; content will not be decompressed even if theMessageProperties.SPRING_AUTO_DECOMPRESS
header is true.void
setDecompressors(Map<String,MessagePostProcessor> decompressors)
Replace all the decompressors.void
setOrder(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
-
setOrder
public void setOrder(int order)
Set the order.- Parameters:
order
- the order.- See Also:
Ordered
-
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 itscontent-encoding
property matches, or begins with this key followed by ":".decompressor
- the decompressingMessagePostProcessor
.
-
removeDecompressor
public MessagePostProcessor removeDecompressor(String contentEncoding)
Remove the decompressor for this encoding; content will not be decompressed even if theMessageProperties.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 interfaceMessagePostProcessor
- Parameters:
message
- the message.- Returns:
- the message.
- Throws:
AmqpException
- an exception.
-
-