title: Error on Delivery Message on Spring WebSocket using StompClient
body: <p>I'm trying to send messages to my topic, but the problem is when I send the message nothing happens... I'm using apache tomcat 7.0.53</p>
  <blockquote>
  <p>UPDATE: 04/15: Link to test:</p>
  <p><a href="http://ec2-54-187-72-145.us-west-2.compute.amazonaws.com:8080/kupo" rel="nofollow noreferrer">http://ec2-54-187-72-145.us-west-2.compute.amazonaws.com:8080/kupo</a></p>
  <p>Login: admin</p>
  <p>Password: admin</p>
  <p><strong>LINK TO ACCESS TOMCAT LOG:</strong></p>
  <p><a href="http://ec2-54-187-72-145.us-west-2.compute.amazonaws.com:28778/" rel="nofollow noreferrer">http://ec2-54-187-72-145.us-west-2.compute.amazonaws.com:28778/</a></p>
  <p>P.S: You need to checked the combobox on the sidebar to start watch the messages</p>
  </blockquote>
  <p><strong>Github Link: <a href="https://github.com/tiarebalbi/kupo" rel="nofollow noreferrer">https://github.com/tiarebalbi/kupo</a></strong></p>
  <p>LOG:</p>
  <pre><code>DEBUG - gWebSocketHandlerDecorator - Connection established, SockJS session id=_mqg8qer, uri=/kupo/application/807/_mqg8qer/websocket
  DEBUG - StompDecoder               - Decoded [Payload byte[0]][Headers=    {stompCommand=CONNECT, nativeHeaders={heart-beat=[10000,10000], accept-version=[1.1,1.0]},     simpMessageType=CONNECT, id=e79a615e-5522-a0f9-aecf-6ea5a54b3d9b, timestamp=1397013491497}]
  DEBUG - StompEncoder               - Encoded STOMP command=CONNECTED headers={user-name=[balbi], heart-beat=[0,0], version=[1.1]}
  DEBUG - StompDecoder               - Decoded [Payload byte[0]][Headers={stompCommand=SUBSCRIBE, nativeHeaders={id=[sub-0], destination=[/topic/greetings]}, simpMessageType=SUBSCRIBE, simpSubscriptionId=sub-0, simpDestination=/topic/greetings, id=42c2019d-96a0-95f0-29aa-2bcc62d6d721, timestamp=1397013491501}]
  </code></pre>
  <p>CODE:</p>
  <pre><code>@Service
  public class ExampleServiceImpl implements ApplicationListener&lt;BrokerAvailabilityEvent&gt; {
  
  private AtomicBoolean brokerAvailable = new AtomicBoolean();
  
  @Autowired
  private MessageSendingOperations&lt;String&gt; messagingTemplate;
  
  @Override
  public void onApplicationEvent(BrokerAvailabilityEvent event) {
      this.brokerAvailable.set(event.isBrokerAvailable());
  }
  
  @Scheduled(fixedDelay=3000)
  public void testing() {
      if (this.brokerAvailable.get()) {
          this.messagingTemplate.convertAndSend(&quot;/topic/greetings&quot;, &quot;Testing....&quot;);
      }
  }
  </code></pre>
  <p>Javascript Connect:</p>
  <pre><code>        var socket = new SockJS('/kupo/application'); // &lt;!-- My endpoint
          var stompClient = Stomp.over(socket);
          stompClient.connect({}, function(frame) {
              
              var username = frame.headers['user-name'];
              console.log(&quot;User connected: &quot; + username);
              
              stompClient.subscribe(&quot;/topic/greetings&quot;, function(message) { // &lt;-- Topic where I want to received the message
                  console.log(&quot;TOPIC:&quot;,message);
              });
              
          } , function(error) {
              console.log(&quot;STOMP protocol error &quot; + error);
          });
  </code></pre>
  <p><strong>Browser Console:</strong></p>
  <pre><code>Opening Web Socket... stomp.min.js:8
  Web Socket Opened... stomp.min.js:8
  &gt;&gt;&gt; CONNECT
  accept-version:1.1,1.0
  heart-beat:10000,10000
  
  &lt;&lt;&lt; CONNECTED
  user-name:balbi
  heart-beat:0,0
  version:1.1
  
  connected to server undefined stomp.min.js:8
  User connected: balbi 
  &gt;&gt;&gt; SUBSCRIBE
  id:sub-0
  destination:/topic/greetings
  </code></pre>
  <p><img src="https://i.stack.imgur.com/oDtrM.png" alt="Browser Console" /></p>
  <p><strong>Websocket Context Configuration:</strong></p>
  <pre><code>@Configuration
  @EnableWebSocketMessageBroker
  public class WebSocketApplicationContext extends AbstractWebSocketMessageBrokerConfigurer {
  
  @Autowired
  private Environment env;
  
  @Override
  public void registerStompEndpoints(StompEndpointRegistry registry) {
      if (env.acceptsProfiles(&quot;test.tomcat&quot;)) {
          registry.addEndpoint(&quot;/application&quot;)
                  .setHandshakeHandler(
                          new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy()))
                  .withSockJS();
      } else {
          registry.addEndpoint(&quot;/application&quot;).withSockJS();
      }
  }
  
  @Override
  public void configureMessageBroker(MessageBrokerRegistry registry) {
      registry.enableSimpleBroker(&quot;/queue/&quot;, &quot;/topic/&quot;);
      registry.setApplicationDestinationPrefixes(&quot;/app&quot;);
  }
  }
  </code></pre>