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

config.enableSimpleBroker("/topic", "/queue"); Should be config.enableSimpleBroker("/topic", "queue");

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.13
    • Fix Version/s: 4.3.14, 5.0.3
    • Component/s: [Documentation]
    • Labels:
      None

      Description

      Hello, there is a error in WebSocket document, https://docs.spring.io/spring/docs/4.3.x/spring-framework-reference/html/websocket.html
      the Doc says: I shoud config Borker as :
      config.enableSimpleBroker("/topic", "/queue");

      but if I conifg as above, the following code won't work:
      template.convertAndSendToUser("Aray","/queue/trade",new Greeting("hhhh"));

      The working config should be :
      config.enableSimpleBroker("/topic", "queue"); (it is "queue" NOT "/queue")

      I debuged and found this: the message send by template.convertAndSendToUser, its destination will finnally be changed into a string like this: "queue/trade-users4pkn4bg", it doesn't start with "/queue".
      and the method org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler#checkDestinationPrefix will return *false *if we config "/queue" as the Doc says.

      I am not sure, we should change the Doc or change the Java Codes.

      thanks

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              Aray Aray Chou
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 37 weeks, 4 days ago