Examples of StompFrame


Examples of io.netty.handler.codec.stomp.StompFrame

    private ClientState state;

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        state = ClientState.AUTHENTICATING;
        StompFrame connFrame = new DefaultStompFrame(StompCommand.CONNECT);
        connFrame.headers().set(StompHeaders.ACCEPT_VERSION, "1.2");
        connFrame.headers().set(StompHeaders.HOST, StompClient.HOST);
        connFrame.headers().set(StompHeaders.LOGIN, StompClient.LOGIN);
        connFrame.headers().set(StompHeaders.PASSCODE, StompClient.PASSCODE);
        ctx.writeAndFlush(connFrame);
    }
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        stompConnection = new StompConnection();
        stompConnection.open("localhost", 61614);
        // Creating a temp queue
        stompConnection.sendFrame("CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL);

        StompFrame frame = stompConnection.receive();
        assertTrue(frame.toString().startsWith("CONNECTED"));

        stompConnection.subscribe("/temp-queue/meaningless", "auto");
        stompConnection.send("/temp-queue/meaningless", "Hello World");

        frame = stompConnection.receive(3000);
        assertEquals("Hello World", frame.getBody());

        Thread.sleep(1000);

        assertEquals("Destination", 1, brokers.get("BrokerA").broker.getAdminView().getTemporaryQueues().length);
        assertEquals("Destination", 1, brokers.get("BrokerB").broker.getAdminView().getTemporaryQueues().length);
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        StompConnection connection = new StompConnection();
        connection.open(stompUri.getHost(), stompUri.getPort());
        connection.connect("user", "password");
        connection.subscribe( "/queue/test" );

        StompFrame message;
        String allMessageBodies = "";
        try {
            while( true ) {
                message = connection.receive(5000);
                allMessageBodies = allMessageBodies +"\n"+ message.getBody();
            }
        } catch (SocketTimeoutException e) {}

        LOG.debug( "All message bodies : " + allMessageBodies );
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        stompConnection = new StompConnection();
        stompConnection.open("localhost", 61614);
        // Creating a temp queue
        stompConnection.sendFrame("CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL);

        StompFrame frame = stompConnection.receive();
        assertTrue(frame.toString().startsWith("CONNECTED"));

        stompConnection.subscribe("/temp-queue/meaningless", "auto");
        stompConnection.send("/temp-queue/meaningless", "Hello World");

        frame = stompConnection.receive(3000);
        assertEquals("Hello World", frame.getBody());

        Thread.sleep(1000);

        assertEquals("Destination", 1, brokers.get("BrokerA").broker.getAdminView().getTemporaryQueues().length);
        assertEquals("Destination", 1, brokers.get("BrokerB").broker.getAdminView().getTemporaryQueues().length);
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        StompConnection connection = new StompConnection();
        connection.open(stompUri.getHost(), stompUri.getPort());
        connection.connect("user", "password");
        connection.subscribe( "/queue/test" );

        StompFrame message;
        String allMessageBodies = "";
        try {
            while( true ) {
                message = connection.receive(5000);
                allMessageBodies = allMessageBodies +"\n"+ message.getBody();
            }
        } catch (SocketTimeoutException e) {}

        LOG.debug( "All message bodies : " + allMessageBodies );
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        stompConnection = new StompConnection();
        stompConnection.open("localhost", 61614);
        // Creating a temp queue
        stompConnection.sendFrame("CONNECT\n" + "login: system\n" + "passcode: manager\n\n" + Stomp.NULL);

        StompFrame frame = stompConnection.receive();
        assertTrue(frame.toString().startsWith("CONNECTED"));

        stompConnection.subscribe("/temp-queue/meaningless", "auto");
        stompConnection.send("/temp-queue/meaningless", "Hello World");

        frame = stompConnection.receive(3000);
        assertEquals("Hello World", frame.getBody());

        Thread.sleep(1000);

        assertEquals("Destination", 1, brokers.get("BrokerA").broker.getAdminView().getTemporaryQueues().length);
        assertEquals("Destination", 1, brokers.get("BrokerB").broker.getAdminView().getTemporaryQueues().length);
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        stompConnection = new StompConnection();
        stompConnection.open("localhost", 61614);
        // Creating a temp queue
        stompConnection.sendFrame("CONNECT\n" + "login:system\n" + "passcode:manager\n\n" + Stomp.NULL);

        StompFrame frame = stompConnection.receive();
        assertTrue(frame.toString().startsWith("CONNECTED"));

        stompConnection.subscribe("/temp-queue/meaningless", "auto");
        stompConnection.send("/temp-queue/meaningless", "Hello World");

        frame = stompConnection.receive(3000);
        assertEquals("Hello World", frame.getBody());

        Thread.sleep(1000);

        assertEquals("Destination", 1, brokers.get("BrokerA").broker.getAdminView().getTemporaryQueues().length);
        assertEquals("Destination", 1, brokers.get("BrokerB").broker.getAdminView().getTemporaryQueues().length);
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

    public void stompConnectTo(String host, int port) throws Exception {
        StompConnection stompConnection = new StompConnection();
        stompConnection.open(createSocket(host, port));
        stompConnection.sendFrame("CONNECT\n" + "\n" + Stomp.NULL);
        StompFrame f = stompConnection.receive();
        TestCase.assertEquals(f.getBody(), "CONNECTED", f.getAction());
        stompConnection.close();
    }
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        int port = broker.getConnectorByName(connectorName).getConnectUri().getPort();
        stompConnection.open(createSocket(host, port));
        String extra = extraHeaders != null ? extraHeaders : "\n";
        stompConnection.sendFrame("CONNECT\n" + extra + "\n" + Stomp.NULL);

        StompFrame f = stompConnection.receive();
        TestCase.assertEquals(f.getBody(), "CONNECTED", f.getAction());
        stompConnection.close();
    }
View Full Code Here

Examples of org.apache.activemq.transport.stomp.StompFrame

        StompConnection connection = new StompConnection();
        connection.open(stompUri.getHost(), stompUri.getPort());
        connection.connect("user", "password");
        connection.subscribe( "/queue/test" );

        StompFrame message;
        String allMessageBodies = "";
        try {
            while( true ) {
                message = connection.receive(5000);
                allMessageBodies = allMessageBodies +"\n"+ message.getBody();
            }
        } catch (SocketTimeoutException e) {}

        LOG.debug( "All message bodies : " + allMessageBodies );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.