title: StompSessionHandler not calling handleFrame in afterConnected block?
body: <p>I have a fairly simple setup to test Stomp support in Spring.</p>
  
  <p>I was planning on using JS to send messages to the queue and receive and handle them in Spring app. However, it doesn't seem to work for some reason.</p>
  
  <p>JS client:</p>
  
  <pre><code>var ws = new SockJS('/hello');
  client = Stomp.over(ws);
  ...
  client.subscribe('jms.queue.test', function(message) {}
  ...
  client.send("jms.queue.test", {}, "message");
  </code></pre>
  
  <p>Spring config (mostly useless at the moment, since i don't use <code>/app</code> destination):</p>
  
  <pre><code>@Configuration
  @EnableWebSocketMessageBroker
  public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
  
      @Override
      public void configureMessageBroker(MessageBrokerRegistry config) {
          config.enableStompBrokerRelay("jms.topic", "jms.queue");
          config.setApplicationDestinationPrefixes("/app");
          config.setPathMatcher(new AntPathMatcher("."));
      }
  
      @Override
      public void registerStompEndpoints(StompEndpointRegistry registry) {
          registry.addEndpoint("/hello").withSockJS();
      }
  }
  </code></pre>
  
  <p>Spring Boot App:</p>
  
  <pre><code>@Component
  public class BusinessLogic implements CommandLineRunner {
  
      @Autowired
      hulloController controller;
  
      @Override
      public void run(String... args) throws Exception {
          stuff(args);
      }
  
      public void stuff(String[] args) throws InterruptedException {
          Thread.sleep(20000);//sleep while spring boot fully initializes
          controller.waitForGreet();
      }
  }
  </code></pre>
  
  <p>Controller (not a real <code>@Controller</code>, i don't plan to use MVC):</p>
  
  <pre><code>@Component
  public class hulloController {
  
      private SimpMessagingTemplate template;
  
      @Autowired
      StompSessionHandler handler;
  
      @Autowired
      public hulloController(SimpMessagingTemplate template) {
          this.template = template;
      }
  
      public void waitForGreet() {
          System.out.println("Entered Listener");
  
          WebSocketClient transport = new StandardWebSocketClient();
          WebSocketStompClient stompClient = new WebSocketStompClient(transport);
          stompClient.setMessageConverter(new StringMessageConverter());
          stompClient.connect("ws://127.0.0.1:61613/stomp", handler);
      }
  }
  </code></pre>
  
  <p>And finally, the handler:</p>
  
  <pre><code>@Component
  public class SessionHandler implements StompSessionHandler {
      @Override
      public void afterConnected(StompSession stompSession, StompHeaders stompHeaders) {
          System.out.println("Connected!");
          StompFrameHandler handler = new StompFrameHandler() {
              @Override
              public Type getPayloadType(StompHeaders stompHeaders) {
                  return null;
              }
  
              @Override
              public void handleFrame(StompHeaders stompHeaders, Object o) {
                  System.out.println("received " + o.toString());
              }
          };
  
          //StompSession.Subscription s = stompSession.subscribe("jms.queue.test", handler);
  
          stompSession.send("jms.queue.test", "hello!");
      }
      ...
  }
  </code></pre>
  
  <p>If i comment the <code>client.subscribe</code> part, <code>client.send</code> works properly, message is received and rendered in JS, so the queue names and connection URL are fine. I also tried using <code>SockJSClient</code> as a Transport but it doesn't help.</p>
  
  <p>When i send messages from JS, for about 1 or 2 minutes half of them isn't showing up (as it would be if the subscription would be working), then JS starts receiving 100% of the messages.</p>
  
  <p>I've seen plenty of almost identical code on github today, and i just don't see what the issue might be here. </p>