title: Sending multiple messages to the same topic with Stomp
body: <p>so I'm trying to send messages back to my browser from the server and have two methods that are supposed to be wired to send the messages to the STOMP topic.</p>
  
  <pre><code>@MessageMapping("/hello")
  @SendTo("/topic/greetings")
  public static Greeting greeting(HelloMessage message) throws Exception {
      System.out.println("Sending message...");
      Application.startBody(message.getName());
      return new Greeting("Hello, " + message.getName() + "!");
  }
  
  @SendTo("/topic/greetings")
  public static  Greeting security(String message) {
      System.out.println("entered the informer");
      return new Greeting("bye, " + message + "!");
  }
  </code></pre>
  
  <p>The first one is also mapped to receive messages and send one back. The first funciton works and the message makes it back to the browser and displays on the webpage. The second once however, does not work. It never displays a received message in the console of the web page. Can I only send to the same topic with one method? I tried changing the topic and adding a subscription to my Stomp client but that didn't work either. Does it have anything to do with the second method being static? (I need to call it from a separate class.)</p>
  
  <p>This is my subscription in the html file:</p>
  
  <pre><code>    function connect() {
          var socket = new SockJS("http://localhost:8080/hello");
          stompClient = Stomp.over(socket);
          stompClient.connect({}, function(frame) {
              setConnected(true);
              console.log('Connected: ' + frame);
              stompClient.subscribe('/topic/greetings', function(greeting){
                  showGreeting(JSON.parse(greeting.body).content);
              });
          });
      }
  </code></pre>
  
  <p>And here is my WebSocketConfig.java:</p>
  
  <pre><code>import org.springframework.context.annotation.Configuration;
  import org.springframework.messaging.simp.config.MessageBrokerRegistry;
  import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
  import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
  import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
  
  @Configuration
  @EnableWebSocketMessageBroker
  public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
  
      @Override
      public void configureMessageBroker(MessageBrokerRegistry config) {
          config.setApplicationDestinationPrefixes("/app").enableSimpleBroker("/queue","/topic");
      }
  
      @Override
      public void registerStompEndpoints(StompEndpointRegistry registry) {
          registry.addEndpoint("/hello").withSockJS();
      }
  
  }
  </code></pre>