Package org.apache.qpid.transport

Examples of org.apache.qpid.transport.Session.sync()


        conn.connect("localhost", QpidBrokerTestCase.DEFAULT_PORT, "test", "guest", "guest",false);
        Session sess = conn.createSession(0);
        sess.exchangeDeclare(exch, "direct", null, null);
        sess.queueDeclare(qname, null, null);
        sess.exchangeBind(qname, exch, routkey, null);
        sess.sync();
        conn.close();       
    }

    private Destination getDestination(String exch, String routkey, String qname) throws Exception
    {
View Full Code Here


            }
            Session sess = conn.createSession(0);
            sess.exchangeDeclare(exch, "direct", null, null);
            sess.queueDeclare(qname, null, null);
            sess.exchangeBind(qname, exch, routkey, null);
            sess.sync();
            conn.close();       
    }

    private Destination getDestination(String exch, String routkey, String qname)
            throws Exception
View Full Code Here

        session.messageTransfer("amq.direct", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
                                new Header(deliveryProps),
                                "That's all, folks!");

        // confirm completion
        session.sync();

        //cleanup
        session.close();
        con.close();
    }
View Full Code Here

        // declare and bind queue
        session.queueDeclare("message_queue", null, null);
        session.exchangeBind("message_queue", "amq.direct", "routing_key", null);

        // confirm completion
        session.sync();

        //cleanup
        session.close();
        con.close();
    }
View Full Code Here

        // XXX
        session.messageFlow("listener_destination", MessageCreditUnit.BYTE, Session.UNLIMITED_CREDIT);
        session.messageFlow("listener_destination", MessageCreditUnit.MESSAGE, 11);

        // confirm completion
        session.sync();

        // wait to receive all the messages
        System.out.println("Waiting 100 seconds for messages from listener_destination");
        Thread.sleep(100*1000);
        System.out.println("Shutting down listener for listener_destination");
View Full Code Here

        session.messageTransfer("amq.fanout", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
                                new Header(deliveryProps),
                                "That's all, folks!");

        // confirm completion
        session.sync();

        //cleanup
        session.close();
        con.close();
    }
View Full Code Here

        // declare and bind queue
        session.queueDeclare("message_queue", null, null);
        session.exchangeBind("message_queue", "amq.fanout",null, null);

        // confirm completion
        session.sync();

        //cleanup
        session.close();
        con.close();
    }
View Full Code Here

        // XXX
        session.messageFlow("listener_destination", MessageCreditUnit.BYTE, Session.UNLIMITED_CREDIT);
        session.messageFlow("listener_destination", MessageCreditUnit.MESSAGE, 11);

        // confirm completion
        session.sync();

        // check to see if we have received all the messages
        System.out.println("Waiting 100 seconds for messages from listener_destination");
        Thread.sleep(100*1000);
        System.out.println("Shutting down listener for listener_destination");
View Full Code Here

        publisher.publishMessages(session, "usa.weather");
        publisher.publishMessages(session, "europe.news");
        publisher.publishMessages(session, "europe.weather");

        // confirm completion
        session.sync();

        //cleanup
        session.close();
        con.close();
    }
View Full Code Here

        listener.prepareQueue(session,"europe", "europe.#");
        listener.prepareQueue(session,"news", "#.news");
        listener.prepareQueue(session,"weather", "#.weather");

        // confirm completion
        session.sync();

        System.out.println("Waiting 100 seconds for messages");
        Thread.sleep(100*1000);

        System.out.println("Shutting down listeners");
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.