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
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an instance with the default decompressors (gzip, zip, deflate) with the alwaysDecompress flag set to true. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDecompressor(String contentEncoding, MessagePostProcessor decompressor) Add a message post processor to the map of decompressing MessageProcessors.intgetOrder()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_DECOMPRESSheader is true.voidsetDecompressors(Map<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, waitMethods 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-encodingproperty 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_DECOMPRESSheader 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:MessagePostProcessorChange (or replace) the message.- Specified by:
postProcessMessagein interfaceMessagePostProcessor- Parameters:
message- the message.- Returns:
- the message.
- Throws:
AmqpException- an exception.
-