Move common APIs from rabbit module to core#3289
Merged
cppwfs merged 1 commit intospring-projects:mainfrom Jan 16, 2026
Merged
Conversation
Some exceptions and listener supporting classes are not only for RabbitMQ integration. They can be used in any other Spring AMQP implementations. * Deprecate existing classes in favor of their new counterpart with extensions where possible. * Still use instances of deprecated classes for proper upper bound of the consumers of the target API, essentially following Postel's Law * Move `ContainerUtilsTests` to `core` module as we don't test a deprecated class any more * Add `reactor-core` optional dependency to `core` module to satisfy `ContinuationHandlerMethodArgumentResolver` requirements
Member
Author
|
The PR is huge, but all those new classes are just moved from their old places.
Thanks |
cppwfs
approved these changes
Jan 16, 2026
| public static boolean shouldRequeue(boolean defaultRequeueRejected, Throwable throwable, Log logger) { | ||
| boolean shouldRequeue = defaultRequeueRejected || | ||
| throwable instanceof MessageRejectedWhileStoppingException; | ||
| Throwable t = throwable; |
Contributor
There was a problem hiding this comment.
Why not use throwable instead of assigning it to t?
Member
Author
There was a problem hiding this comment.
Because we do t = cause; a bit bellow in the logic.
And good practice is not to mutate method argument.
Kinda treat all the method arguments as final.
| this.failedMessages = new ArrayList<>(Arrays.asList(failedMessage)); | ||
| } | ||
|
|
||
| public @Nullable Message getFailedMessage() { |
Contributor
There was a problem hiding this comment.
Feels like this should be getFirstFailedMessage
Member
Author
There was a problem hiding this comment.
That is how it was there for for years and I'm fully OK with this contract.
Mostly this exception is created with a single failed message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some exceptions and listener supporting classes
are not only for RabbitMQ integration.
They can be used in any other Spring AMQP implementations.
ContainerUtilsTeststocoremodule as we don't test a deprecated class any morereactor-coreoptional dependency tocoremodule to satisfyContinuationHandlerMethodArgumentResolverrequirements