You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#920
The `AsyncRabbitTemplate` is missing an after receive post-processing
in its internal containers for replies
* Reuse `afterPostProcessors` from the provided `RabbitTemplate` and
propagate them into the internal listener containers for replies
* Fix `AbstractCompressingPostProcessor` do not mutate provided
`MessageProperties` and build a fresh instance.
* Demonstrate post-processors propagation by the `GZipPostProcessor`
& `GUnzipPostProcessor` configuration in the `AsyncRabbitTemplateTests`
**Cherry-pick to 2.1.x**
* Use `JavaUtils` for nullable settings in the `AsyncRabbitTemplate`
* Add `copyProperties` option to the `AbstractCompressingPostProcessor`
with `false` by default for better performance
* Document a `copyProperties` in the `amqp.adoc`
Copy file name to clipboardExpand all lines: spring-amqp/src/main/java/org/springframework/amqp/support/postprocessor/AbstractCompressingPostProcessor.java
Copy file name to clipboardExpand all lines: src/reference/asciidoc/amqp.adoc
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3432,6 +3432,11 @@ The second is invoked immediately after a message is received.
3432
3432
These extension points are used for such features as compression and, for this purpose, several `MessagePostProcessor` implementations are provided.
3433
3433
`GZipPostProcessor` and `ZipPostProcessor` compress messages before sending, and `GUnzipPostProcessor` and `UnzipPostProcessor` decompress received messages.
3434
3434
3435
+
NOTE: Starting with version 2.1.5, the `GZipPostProcessor` can be configured with the `copyProperties = true` option to make a copy of the original message properties.
3436
+
By default, these properties are reused for performance reasons, and modified with compression content encoding and the optional `MessageProperties.SPRING_AUTO_DECOMPRESS` header.
3437
+
If you retain a reference to the original outbound message, its properties will change as well.
3438
+
So, if your application retains a copy of an outbound message with these message post processors, consider turning the `copyProperties` option on.
3439
+
3435
3440
Similarly, the `SimpleMessageListenerContainer` also has a `setAfterReceivePostProcessors()` method, letting the decompression be performed after messages are received by the container.
3436
3441
3437
3442
Starting with version 2.1.4, `addBeforePublishPostProcessors()` and `addAfterReceivePostProcessors()` have been added to the `RabbitTemplate` to allow appending new post processors to the list of before publish and after receive post processors respectively.
0 commit comments