Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-1009

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 3.0.0.RELEASE
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None

      Description

      Sorry, I submit to the wrong project, I resubmit this issue to : https://jira.spring.io/browse/SPR-16275 please close this, thanks.

      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

        Activity

        Hide
        Aray Aray Chou added a comment -

        I didn't find the project of WebSocket, I am not sure it is correct or not to choose "Spring Web Services" as project. and I use org.springframework.boot:spring-boot-starter-websocket:1.5.9.RELEASE to start my test codes

        Show
        Aray Aray Chou added a comment - I didn't find the project of WebSocket, I am not sure it is correct or not to choose "Spring Web Services" as project. and I use org.springframework.boot:spring-boot-starter-websocket:1.5.9.RELEASE to start my test codes

          People

          • Assignee:
            Unassigned
            Reporter:
            Aray Aray Chou
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: