Skip to content

Allow use of "." as path separator in @MessageMapping methods and in simple broker [SPR-11660] #16283

@spring-projects-issues

Description

@spring-projects-issues

Rossen Stoyanchev opened SPR-11660 and commented

At present STOMP destinations are mapped to @MessageMapping methods with Ant-style patterns. Likewise the simple message broker supports Ant-style patterns style destinations.

This is okay since in STOMP destination are opaque and brokers are free to define the exact semantics. Ant style patterns are an attractive choice for web development due to their similarity to URL paths.

In messaging however "." is more commonly used as a separator and may be a more fitting choice. This ticket is to explore the possibility of using "." instead of "/" as separator. The AntPathMatcher does support using another separator char, so it might even be trivial to switch the style for message mapping purposes.

As for wildcard support it can differ across brokers. A wildcard is commonly used for matching one segment. Recursive matching however varies, e.g. # (hash) in AMQP, ** in Apollo, > in ActiveMQ. It may be relatively easy to make AntPatcher configurable with regards to what it uses for recursive matching. That would make it possible for the simple broker to support all of those and therefore make it easier to switch from the simple broker to a full featured broker.

The configuration could expose this centrally, e.g. default separator, single match and recursive match characters.


Affects: 4.0.3

Sub-tasks:

Referenced from: commits spring-attic/spring-framework-issues@3297657, spring-attic/spring-framework-issues@aeed125

1 votes, 3 watchers

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