Problems with RabbitMQ and web-stomp
<p>I'm using RabbitMQ and web-stomp in the web browser according to this tutorial:
<a href="https://www.rabbitmq.com/web-stomp.htm" rel="nofollow">https://www.rabbitmq.com/web-stomp.htm</a></p>

<p>I succeded to connect and the get messages in the browser.</p>

<p>But,</p>

<ol>
<li><p>the message I sent and consumed in the client is still in the queue and not being dequeing(I did manual ack and auto ack), it still exists.</p></li>
<li><p>when I subscribe to a queue I'm not getting all the messages in the queue, but only the last.. only when the websocket is open and then the server send the message i get the last message but not the old ones.</p></li>
</ol>

<p>The server Code:</p>

<pre><code>private static final String EXCHANGE_NAME = "amq.topic";

public static void AddToQueue(String RoutingKey, String message) throws IOException, TimeoutException {
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("localhost");
        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "topic");

        channel.basicPublish(EXCHANGE_NAME, RoutingKey, null, message.getBytes());

        channel.close();
        connection.close();
}
</code></pre>

<p>The client code:</p>

<pre><code> var ws = new SockJS('http://' + window.location.hostname + ':15674/stomp');
$scope.client = Stomp.over(ws);
$scope.client.heartbeat.outgoing = 0;
$scope.client.heartbeat.incoming = 0;
var on_connect = function(x) {
       $scope.client.subscribe("/topic/status", function(d) {
           console.log(d.body);
});
};
var on_error =  function() {
    console.log('error');
};
$scope.client.connect('guest', 'guest', on_connect, on_error, '/');
</code></pre>

<p>Thanks. </p>