Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior Change in Exception Handling with Ordered Message Processing #33937

Open
csh0034 opened this issue Nov 22, 2024 · 3 comments
Open

Behavior Change in Exception Handling with Ordered Message Processing #33937

csh0034 opened this issue Nov 22, 2024 · 3 comments
Labels
in: messaging Issues in messaging modules (jms, messaging) status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@csh0034
Copy link

csh0034 commented Nov 22, 2024

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 22, 2024
@csh0034
Copy link
Author

csh0034 commented Nov 22, 2024

The STOMP 1.2 specification states as follows

If the server cannot successfully create the subscription, the server MUST send the client an ERROR frame and then close the connection.

@bclozel
Copy link
Member

bclozel commented Nov 22, 2024

It's hard to know which code path exactly has changed given your description.
Can you provide a minimal sample application on the latest Spring Boot 3.3.x that shows this behavior and works differently with the latest 3.2.x version ?
This would help us track down Hat changes and whether this is an unintended effect.
Thanks

@bclozel bclozel added status: waiting-for-feedback We need additional information before we can continue in: messaging Issues in messaging modules (jms, messaging) labels Nov 22, 2024
@csh0034
Copy link
Author

csh0034 commented Nov 22, 2024

websocket-sample.zip

I have added a test case to check if StompSubProtocolErrorHandler is invoked depending on the registry.setPreserveReceiveOrder(true) configuration.

Additionally, I started working from version 3.3.0, so I'm not sure if the issue was introduced due to changes in the 3.3.x version.

The issue remains the same even when using the latest Spring Boot 3.3.x.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

3 participants