Examples of StompJmsConnectionFactory


Examples of org.fusesource.stomp.jms.StompJmsConnectionFactory

*/
public class StompBrokerProtocol extends BrokerProtocol {

    @Override
    ConnectionFactory getConnectionFactory(Object broker) {
        StompJmsConnectionFactory factory = new StompJmsConnectionFactory();
        factory.setBrokerURI(format("tcp://localhost:%s", port(broker)));
        return factory;
    }
View Full Code Here

Examples of org.fusesource.stomp.jms.StompJmsConnectionFactory

        DetectingGateway gateway = startDetectingGateway();

        final ShutdownTracker tracker = new ShutdownTracker();

        // Run some concurrent load against the broker via the gateway...
        final StompJmsConnectionFactory factory = new StompJmsConnectionFactory();
        factory.setBrokerURI("tcp://localhost:"+gateway.getBoundPort());

        for(int client=0; client<10; client++) {
            new Thread("JMS Client: "+client) {
                @Override
                public void run() {
                    while(tracker.attemptRetain()) {
                        try {
                            Connection connection = factory.createConnection();
                            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                            MessageConsumer consumer = session.createConsumer(session.createTopic("FOO"));
                            MessageProducer producer = session.createProducer(session.createTopic("FOO"));
                            producer.send(session.createTextMessage("Hello"));
                            consumer.receive(1000);
View Full Code Here

Examples of org.fusesource.stompjms.StompJmsConnectionFactory

        String body = "";
        for( int i=0; i < size; i ++) {
            body += DATA.charAt(i%DATA.length());
        }

        StompJmsConnectionFactory factory = new StompJmsConnectionFactory();
        factory.setBrokerURI("tcp://" + host + ":" + port);

        Connection connection = factory.createConnection(user, password);
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination dest = StompJmsDestination.createDestination(destination);
        MessageProducer producer = session.createProducer(dest);
        producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
View Full Code Here

Examples of org.fusesource.stompjms.StompJmsConnectionFactory

        String password = env("STOMP_PASSWORD", "password");
        String host = env("STOMP_HOST", "localhost");
        int port = Integer.parseInt(env("STOMP_PORT", "61613"));
        String destination = arg(args, 0, "/topic/event");

        StompJmsConnectionFactory factory = new StompJmsConnectionFactory();
        factory.setBrokerURI("tcp://" + host + ":" + port);

        Connection connection = factory.createConnection(user, password);
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination dest = StompJmsDestination.createDestination(destination);

        MessageConsumer consumer = session.createConsumer(dest);
View Full Code Here

Examples of org.fusesource.stompjms.StompJmsConnectionFactory

        String password = env("STOMP_PASSWORD", "password");
        String host = env("STOMP_HOST", "localhost");
        int port = Integer.parseInt(env("STOMP_PORT", "61613"));
        String destination = arg(args, 0, "/topic/event");

        StompJmsConnectionFactory factory = new StompJmsConnectionFactory();
        factory.setBrokerURI("tcp://" + host + ":" + port);

        Connection connection = factory.createConnection(user, password);
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination dest = StompJmsDestination.createDestination(destination);

        MessageConsumer consumer = session.createConsumer(dest);
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.