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

Support @SendTo at the class level [SPR-13578] #18155

Closed
spring-projects-issues opened this issue Oct 16, 2015 · 1 comment
Closed

Support @SendTo at the class level [SPR-13578] #18155

spring-projects-issues opened this issue Oct 16, 2015 · 1 comment
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 16, 2015

Gary Russell opened SPR-13578 and commented

Spring AMQP now supports @RabbitListener at the class level (with method routing via @RabbitHandler ).

When specified at the method level, @SendTo is supported (to route replies that don't have replyTo data).

It would be useful to allow @SendTo at the class level so the same semantics can be supported for class level @RabbitListener.


Affects: 4.2.2

Issue Links:

  • AMQP-542 Class-level @RabbitListener causes INFO log message about NullPointerException

Referenced from: commits a112557

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 15, 2016

Rossen Stoyanchev commented

if you have no annotation or an empty annotation you look for the destination to use in the incoming message

The secret is in the annotationRequired flag if you see how supportsReturnType is written. The SimpAnnotationMethodMessageHandler registers 2 instances of SendToMethodReturnValueHandler - one in the beginning which requires an annotation and one at the end which serves as a default handler for a return value that wasn't handled in any other way.

If you use this new feature with the proposal, it means that the annotation is always present (since we check also the holding class).

If you put @SendTo at the type level it's effectively inherited at the method level and hence applies to all methods.

@spring-projects-issues spring-projects-issues added in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3 RC1 milestone Jan 11, 2019
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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants