title: Listen to a queue in a controller Spring MVC and Spring web socket
body: <p>I have a scenario where we have an application that uses Spring MVC and spring web-socket. I want to write a method in a controller that listens to messages and then once it gets that message it will transform and send it to another queue that the user listens on the client side. </p>
  
  <p>The client side code looks like </p>
  
  <pre><code>    var connect = function() {
      var socket = new SockJS(webSocketUrl);
      stompClient = Stomp.over(socket);
      stompClient.connect({}, function(frame) {
  
          console.log('Connected: ' + frame);
          stompClient.subscribe("/user/queue/test", function(data){ 
              alert(data);               
      }
      }
      );
  </code></pre>
  
  <p>I am not sure how the java code should look like</p>
  
  <pre><code>@SubscribeMapping("/queue/cluwe.controller.sign") 
  public void signMessagesAggregator() {
      String blah = "test";
      simpMessageSendingOperations.convertAndSendToUser("userId", "/queue/test", blah);
  }
  </code></pre>
  
  <p>I know the java part is wrong, but I cant find any documentation in spring-websockets that have a stompClient.subscribe like thing in java. Any ideas?</p>