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 MessagePostProcessor
s
depending on the content encoding. Supports gzip, zip, deflate
by default.- Since:
- 1.4.2
- Author:
- Gary Russell, David Diehl, Ngoc Nhan
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionConstruct an instance with the default decompressors (gzip, zip, deflate) with the alwaysDecompress flag set to true. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDecompressor
(String contentEncoding, MessagePostProcessor decompressor) Add a message post processor to the map of decompressing MessageProcessors.int
getOrder()
postProcessMessage
(Message message) Change (or replace) the message.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
-
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() -
setOrder
public void setOrder(int order) Set the order.- Parameters:
order
- the order.- See Also:
-
addDecompressor
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
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
Replace all the decompressors.- Parameters:
decompressors
- the decompressors.
-
postProcessMessage
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.
-