public abstract class AbstractCompressingPostProcessor extends Object implements MessagePostProcessor, Ordered
getEncoding() or getEncoding() + ":" + existing encoding, if
present.| Modifier and Type | Field and Description |
|---|---|
protected Log |
logger |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AbstractCompressingPostProcessor()
Construct a post processor that will include the
MessageProperties.SPRING_AUTO_DECOMPRESS header set to 'true'. |
AbstractCompressingPostProcessor(boolean autoDecompress)
Construct a post processor that will include (or not include) the
MessageProperties.SPRING_AUTO_DECOMPRESS header. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract OutputStream |
getCompressorStream(OutputStream stream)
Get the stream.
|
protected abstract String |
getEncoding()
Get the encoding.
|
int |
getOrder() |
Message |
postProcessMessage(Message message)
Change (or replace) the message.
|
void |
setCopyProperties(boolean copyProperties)
Flag to indicate if
MessageProperties should be used as is or cloned for new message
after compression. |
protected void |
setOrder(int order)
Set the order.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostProcessMessageprotected final Log logger
public AbstractCompressingPostProcessor()
MessageProperties.SPRING_AUTO_DECOMPRESS header set to 'true'.public AbstractCompressingPostProcessor(boolean autoDecompress)
MessageProperties.SPRING_AUTO_DECOMPRESS header. Used by the (Spring AMQP) inbound
message converter to determine whether the message should be decompressed
automatically, or remain compressed.autoDecompress - true to indicate the receiver should automatically
decompress.public void setCopyProperties(boolean copyProperties)
MessageProperties should be used as is or cloned for new message
after compression.
By default this flag is turned off for better performance since in most cases the original message
is not used any more.copyProperties - clone or reuse original message properties.public Message postProcessMessage(Message message) throws AmqpException
MessagePostProcessorpostProcessMessage in interface MessagePostProcessormessage - the message.AmqpException - an exception.protected void setOrder(int order)
order - the order, default 0.Orderedprotected abstract OutputStream getCompressorStream(OutputStream stream) throws IOException
stream - The output stream to write the compressed data to.IOException - IOExceptionprotected abstract String getEncoding()