Package org.fusesource.stomp.client

Examples of org.fusesource.stomp.client.Stomp


public class StompConsumerTest extends StompBaseTest {

    @Test
    public void testConsume() throws Exception {
        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection producerConnection = stomp.connectBlocking();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(numberOfMessages);

        for (int i = 0; i < numberOfMessages; i++) {
View Full Code Here


public class StompConsumerUriTest extends StompBaseTest {

    @Test
    public void testConsume() throws Exception {
        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection producerConnection = stomp.connectBlocking();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(numberOfMessages);

        for (int i = 0; i < numberOfMessages; i++) {
View Full Code Here

public class StompProducerTest extends StompBaseTest {

    @Test
    public void testProduce() throws Exception {
        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection subscribeConnection = stomp.connectBlocking();

        StompFrame frame = new StompFrame(SUBSCRIBE);
        frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
        frame.addHeader(ID, subscribeConnection.nextId());
        StompFrame response = subscribeConnection.request(frame);
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        final Promise<CallbackConnection> promise = new Promise<CallbackConnection>();

        stomp = new Stomp(configuration.getBrokerURL());
        stomp.setLogin(configuration.getLogin());
        stomp.setPasscode(configuration.getPasscode());
        stomp.connectCallback(promise);

        connection = promise.await();
View Full Code Here

        }

        context.addRoutes(createRouteBuilder());
        context.start();

        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection subscribeConnection = stomp.connectBlocking();

        StompFrame frame = new StompFrame(SUBSCRIBE);
        frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
        frame.addHeader(ID, subscribeConnection.nextId());
        StompFrame response = subscribeConnection.request(frame);
View Full Code Here

        }

        context.addRoutes(createRouteBuilder());
        context.start();

        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection producerConnection = stomp.connectBlocking();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(numberOfMessages);

        for (int i = 0; i < numberOfMessages; i++) {
View Full Code Here

        }

        context.addRoutes(createRouteBuilder());
        context.start();

        Stomp stomp = new Stomp("tcp://localhost:" + getPort());
        final BlockingConnection producerConnection = stomp.connectBlocking();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(numberOfMessages);

        for (int i = 0; i < numberOfMessages; i++) {
View Full Code Here

    @Test
    public void canDetectTheStompProtocol() throws Exception {
        DetectingGateway gateway = createGateway();

        // Lets establish a connection....
        Stomp stomp = new Stomp("localhost", gateway.getBoundPort());
        stomp.setHost("broker0"); // lets connect to the broker0 virtual host..
        org.fusesource.stomp.client.BlockingConnection connection = stomp.connectBlocking();

        assertConnectedToBroker(0);
        connection.close();
    }
View Full Code Here

        this.passcode = passcode;
    }

    public Stomp getStomp() throws Exception {
        if (stomp == null) {
            stomp = new Stomp(brokerURL);
            stomp.setLogin(login);
            stomp.setPasscode(passcode);
        }
        return stomp;
    }
View Full Code Here

public class StompProducerTest extends StompBaseTest {

    @Test
    public void testProduce() throws Exception {
        Stomp stomp = new Stomp("tcp://localhost:61613");
        final BlockingConnection subscribeConnection = stomp.connectBlocking();

        StompFrame frame = new StompFrame(SUBSCRIBE);
        frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
        frame.addHeader(ID, subscribeConnection.nextId());
        StompFrame response = subscribeConnection.request(frame);
View Full Code Here

TOP

Related Classes of org.fusesource.stomp.client.Stomp

Copyright © 2018 www.massapicom. 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.