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
Resolves#1130
`RepublishingMessageRecoverer` - include the exception message length in the
truncation algorithm.
Note that the message is included in the stack trace.
If the stack trace + exception message would exceed the limit
- first truncate the message within the stack trace to 100 bytes
-- if the stack trace and original message still exceed the limit
-- also truncate the `X_EXCEPTION_MESSAGE` header to 100 bytes and
use the remaing space for stack trace
If, after truncating the message in the stack trace, there is room remaining
the full stack trace as well as the truncated message, re-truncate the
`X_EXCEPTION_MESSAGE` header to use the remaining available bytes.
examples:
message 150 bytes, stack trace 350 bytes, available 300 bytes,
stack trace after message truncation 300 bytes
- truncate message to 100, trace to 200
message 200 bytes, stack trace 250 bytes, available 300 bytes,
stack trace after message truncation 150 bytes
- truncate message to 100 bytes, trace to 200
message 200 bytes, stack trace 250 bytes, available 300 bytes,
stack trace after message truncation 150 bytes
- truncate message to 150 bytes, trace remains at 150
These are for illustration only, the available bytes is generally must larger.
**cherry-pick to 2.1.x**
* Fix conflicts in the `RepublishMessageRecovererIntegrationTests` for
current code base around `ListenerExecutionFailedException` and `MessageProperties`
Copy file name to clipboardExpand all lines: spring-rabbit/src/test/java/org/springframework/amqp/rabbit/retry/RepublishMessageRecovererIntegrationTests.java
Copy file name to clipboardExpand all lines: src/reference/asciidoc/amqp.adoc
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5644,6 +5644,16 @@ RepublishMessageRecoverer recoverer = new RepublishMessageRecoverer(amqpTemplate
5644
5644
----
5645
5645
====
5646
5646
5647
+
Starting with version 2.0.5, the stack trace may be truncated if it is too large; this is because all headers have to fit in a single frame.
5648
+
By default, if the stack trace would cause less than 20,000 bytes ('headroom') to be available for other headers, it will be truncated.
5649
+
This can be adjusted by setting the recoverer's `frameMaxHeadroom` property, if you need more or less space for other headers.
5650
+
Starting with versions 2.1.13, 2.2.3, the exception message is included in this calculation, and the amount of stack trace will be maximized using the following algorithm:
5651
+
5652
+
* if the stack trace alone would exceed the limit, the exception message header will be truncated to 97 bytes plus `...` and the stack trace is truncated too.
5653
+
* if the stack trace is small, the message will be truncated (plus `...`) to fit in the available bytes (but the message within the stack trace itself is truncated to 97 bytes plus `...`).
5654
+
5655
+
Whenever a truncation of any kind occurs, the original exception will be logged to retain the complete information.
5656
+
5647
5657
Starting with version 2.1, an `ImmediateRequeueMessageRecoverer` is added to throw an `ImmediateRequeueAmqpException`, which notifies a listener container to requeue the current failed message.
0 commit comments