Refactor SendTo and Subscription Method Return Value Handlers to use … by catturtle123 · Pull Request #36282 · spring-projects/spring-framework
PR Title
Propagate native STOMP headers to broker via HeaderFilter
Summary
This PR implements the propagation of native STOMP headers based on a predicate, as discussed in previous feedback. The core focus is ensuring that specific native headers (e.g., those with an x- prefix) are correctly carried over to the broker-bound messages.
Key Implementation Details:
- Native Header Filtering: Configured
addHeaderFilterto propagate native headers starting with thex-prefix to response messages. - Updated
SendToMethodReturnValueHandler: Supports header propagation for@SendToresponses. - Updated
SubscriptionMethodReturnValueHandler: Supports header propagation for@SubscribeMappingresponses. - Updated unit tests to verify native header propagation via SimpMessageHeaderAccessor
Local Test (not included in this PR)
Related Issues
- Supersedes Make SendToMethodReturnValueHandler and SubscriptionMethodReturnValueHandler customizable, to allow for pass-through of message headers #36179
- Fixes Make
SendToMethodReturnValueHandlerandSubscriptionMethodReturnValueHandlercustomizable, to allow for pass-through of message headers #36168
