Skip to content

SimpleBrokerMessageHandler makes an assertion about the type of the MessageHeaderAccessor, but doesn't seem to care [SPR-14279] #18851

Closed
@spring-projects-issues

Description

@spring-projects-issues
Collaborator

Dave Syer opened SPR-14279 and commented

There's an assertion here: https://github.com/spring-projects/spring-framework/blob/master/spring-messaging/src/main/java/org/springframework/messaging/simp/broker/SimpleBrokerMessageHandler.java#L227. It says that the type of the accessor must be SimpMessageHeaderAccessor. But then the accessor is never actually used, so I'm wondering if the assertion is redundant.

It causes issues if anyone adds a ChannelInterceptor which manipulates headers, which seems like a perfectly valid thing to do, independent of whether you are a websocket client or not.


Affects: 4.2.6

Reference URL: spring-cloud/spring-cloud-sleuth#276

Issue Links:

Backported to: 4.2.7

Activity

spring-projects-issues

spring-projects-issues commented on May 17, 2016

@spring-projects-issues
CollaboratorAuthor

Rossen Stoyanchev commented

This is probably a left-over from before the static accessor methods were added to the MessageHeaderAccessor hierarchy that we can probably remove.

spring-projects-issues

spring-projects-issues commented on May 18, 2016

@spring-projects-issues
CollaboratorAuthor

Dave Syer commented

Could this be back ported to 4.2 please?

added this to the 4.3 GA milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @rstoyanchev@spring-projects-issues

      Issue actions

        SimpleBrokerMessageHandler makes an assertion about the type of the MessageHeaderAccessor, but doesn't seem to care [SPR-14279] · Issue #18851 · spring-projects/spring-framework