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

Annotated class with @SendToUser overrides @SendTo on method [SPR-14238] #18811

Closed
spring-issuemaster opened this issue May 2, 2016 · 4 comments
Closed
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented May 2, 2016

Alex opened SPR-14238 and commented

Since version 4.3 we can annotate a class with @SendToUser in order to avoid to repeat the annotation on every @MessageMapping method in the class, and that's great.

Anyway, that creates a problem when I a method of the class uses a @SendTo annotation: instead of overriding the class wide annotation, it gets ignored.

I think that the correct semantic should be that if a method is annotated with a @SendTo annotation it should ovverride both @SendTo and @SendToUser class wide annotations.


Affects: 4.3 RC1

Issue Links:

  • #21430 Enable use of both @SendTo and @SendToUser on the same method

Referenced from: commits 46e41a9

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 3, 2016

Rossen Stoyanchev commented

This should be fixed now, thanks for raising the issue.

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 3, 2016

Alex commented

Thank to you for fixing it!

There is a similar problem I'm facing now, what if a method uses the @SubscribeMapping annotation (only): how can someone get the default behaviour with a class wide @SendTo or @SendToUser?

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 3, 2016

Rossen Stoyanchev commented

@SendTo and @SendToUser can be used with both @MessageMapping and @SubscribeMapping methods just the same. Once on the class level they apply to all such methods I'm afraid I don't see any other way.

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 4, 2016

Alex commented

Maybe just annotating a method with @SendTo/@SendToUser without any properties to indicate default behaviour like when no class-annotation is defined...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.