You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mjustin <mi...@gmx.net> on 2009/03/21 11:29:38 UTC

Test for Stomp AutoAcknoledge

Hi,

This test (based on StompTest.java in the
org.apache.activemq.transport.stomp package) fails on the fifth message. It
first sends ten messages to a queue and then subscribes ten times in a loop
to read one message.

I am not sure if it has something to do with maximumRedeliveries, but since
the default value for maximumRedeliveries is 6, I guess this might be the
reason, and this behaviour is correct?

    public void testSubscribeWithAutoAck() throws Exception {

        for (int i = 0; i < 10; i++) {
            sendMessage(getName());
        }

        for (int i = 0; i < 10; i++) {
            stompConnection = new StompConnection();
            stompConnect();

            String frame = "CONNECT\n" + "login: system\n" + "passcode:
manager\n\n" + Stomp.NULL;
            stompConnection.sendFrame(frame);

            frame = stompConnection.receiveFrame();
            assertTrue(frame.startsWith("CONNECTED"));

            frame = "SUBSCRIBE\n" + "destination:/queue/" + getQueueName() +
"\n" + "ack:auto\n\n" + Stomp.NULL;
            stompConnection.sendFrame(frame);

            try {
                frame = stompConnection.receiveFrame(2000);
                assertTrue("Message " + i, frame.startsWith("MESSAGE"));
            } catch (SocketTimeoutException ex) {
                fail(ex.getMessage() + " at Message " + i);
            }

            frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
            stompConnection.sendFrame(frame);

            stompDisconnect();
        }

    }
-- 
View this message in context: http://www.nabble.com/Test-for-Stomp-AutoAcknoledge-tp22634591p22634591.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.