Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11660

Allow use of "." as path separator in @MessageMapping methods and in simple broker


    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.1 RC1
    • Component/s: Messaging
    • Labels:
    • Last commented by a User:


      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.




            • Assignee:
              sdeleuze Sébastien Deleuze
              rstoya05-aop Rossen Stoyanchev
              Last updater:
              Stéphane Nicoll
            • Votes:
              1 Vote for this issue
              3 Start watching this issue


              • Created:
                Days since last comment:
                4 years, 19 weeks, 2 days ago