spring-projects / spring-projects/spring-framework
Behavior Change in Exception Handling with Ordered Message Processing
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
I have configured registry.setPreserveReceiveOrder(true); to process received messages in order
and am using Spring Security to perform authorization checks during subscriptions.
Before enabling this option, we were using ExecutorSubscribableChannel, where exceptions were wrapped in a MessageDeliveryException and thrown to the higher layers.
After enabling this option, however, exceptions are caught by OrderedMessageChannelDecorator during processing, preventing error messages from being delivered to the client when subscription authorization fails.
Previously, exceptions were propagated to StompSubProtocolErrorHandler via StompSubProtocolHandler.handleError()
Is this behavior—preventing exceptions from being propagated to the client—an intended design?
Is there a way to propagate exceptions to the client through StompSubProtocolErrorHandler?
The versions in use are Spring Boot 3.3.0 and Spring WebSocket/Message 6.1.8.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the subscription-authorization failure with registry.setPreserveReceiveOrder(true) and compare it with ExecutorSubscribableChannel. Start with OrderedMessageChannelDecorator, then trace StompSubProtocolHandler.handleError() and StompSubProtocolErrorHandler. Done means the intended behavior is established and authorization failures are either propagated to the client or clearly documented as handled internally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100