Skip to content

Add support for default prefix in @SendTo and @SendToUser annotations [SPR-11085] #15711

@spring-projects-issues

Description

@spring-projects-issues

Rossen Stoyanchev opened SPR-11085 and commented

A common expected pattern when using @SendTo and @SendToUser is to broadcast to the same destination as the input message but a different prefix.

For example the client may send a message to "/app/foo" where the prefix "/app" is removed for mapping purposes. The return value from the method may then be broadcast to "/topic/foo" where "/topic" is a default prefix configurable on SendToMethodReturnValueHandler. The message handling method would then simply be:

@MessageMapping("/foo")
public String handleFoo() {
  return "foo";
}

Affects: 4.0 RC1

Referenced from: commits 72dec7d

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions