Package org.springframework.amqp.core
Interface MessagePostProcessor
-
- All Known Implementing Classes:
AbstractCompressingPostProcessor,AbstractDecompressingPostProcessor,AbstractDeflaterPostProcessor,DeflaterPostProcessor,DelegatingDecompressingPostProcessor,GUnzipPostProcessor,GZipPostProcessor,InflaterPostProcessor,UnzipPostProcessor,ZipPostProcessor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MessagePostProcessorUsed in several places in the framework, such asAmqpTemplate#convertAndSend(Object, MessagePostProcessor)where it can be used to add/modify headers or properties after the message conversion has been performed. It also can be used to modify inbound messages when receiving messages in listener containers andAmqpTemplates.It is a
FunctionalInterfaceand is often used as a lambda:amqpTemplate.convertAndSend(routingKey, m -> { m.getMessageProperties().setDeliveryMode(DeliveryMode.NON_PERSISTENT); return m; });
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MessagepostProcessMessage(Message message)Change (or replace) the message.default MessagepostProcessMessage(Message message, Correlation correlation)Change (or replace) the message and/or change its correlation data.default MessagepostProcessMessage(Message message, Correlation correlation, java.lang.String exchange, java.lang.String routingKey)Change (or replace) the message and/or change its correlation data.
-
-
-
Method Detail
-
postProcessMessage
Message postProcessMessage(Message message) throws AmqpException
Change (or replace) the message.- Parameters:
message- the message.- Returns:
- the message.
- Throws:
AmqpException- an exception.
-
postProcessMessage
default Message postProcessMessage(Message message, Correlation correlation)
Change (or replace) the message and/or change its correlation data. Only applies to outbound messages.- Parameters:
message- the message.correlation- the correlation data.- Returns:
- the message.
- Since:
- 1.6.7
-
postProcessMessage
default Message postProcessMessage(Message message, Correlation correlation, java.lang.String exchange, java.lang.String routingKey)
Change (or replace) the message and/or change its correlation data. Only applies to outbound messages.- Parameters:
message- the message.correlation- the correlation data.exchange- the exchange to which the message is to be sent.routingKey- the routing key.- Returns:
- the message.
- Since:
- 2.3.4
-
-