Package javax.jms

Examples of javax.jms.QueueConnection.createQueueSession()


        QueueConnectionFactory factory = finder.getFactory();
        QueueConnection connection = factory.createQueueConnection();
        connection.start();
        QueueSession session =
            connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        Queue readQ = session.createQueue(queueName);
        QueueReceiver receiver =
            session.createReceiver(readQ, "JMSCorrelationID='" + id + "'");
        return receiver.receive(WSIFProperties.getAsyncTimeout());
    }
View Full Code Here


        Queue reservationQueue = (Queue)jndiContext.lookup("java:comp/env/jms/ReservationQueue");
        Queue ticketQueue = (Queue)jndiContext.lookup("java:comp/env/jms/TicketQueue");

        QueueConnection connect = factory.createQueueConnection();

        QueueSession session = connect.createQueueSession(false,0);

        QueueSender sender = session.createSender(reservationQueue);
              
        for (int i = 0; i < count; i++) {
View Full Code Here

      jndiContext.lookup("titan-TicketQueue");

        QueueConnection connect = factory.createQueueConnection();

        QueueSession session =
      connect.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
       
        QueueReceiver receiver = session.createReceiver(ticketQueue);

        receiver.setMessageListener(this);
       
View Full Code Here

    public void testTryToReproduceNullPointerBug() throws Exception {
        String url = bindAddress;
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
        QueueConnection queueConnection = factory.createQueueConnection();
        this.connection = queueConnection;
        QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        session.createSender(null); // Unidentified
        Queue receiverQueue = session.createTemporaryQueue();
        session.createReceiver(receiverQueue);
        queueConnection.start();
    }
View Full Code Here

        for (int i = 0; i < number; i++) {
            Thread thread = new Thread(new Runnable() {
                public void run() {
                    try {
                        QueueConnection connection = createConnection();
                        QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                        Queue queue = session.createTemporaryQueue();
                        session.createReceiver(queue);
                        connection.start();

                        if (count.incrementAndGet() >= number) {
View Full Code Here

            namingContext.close();

            // 2. Create the queue connection
            QueueConnection queueConnection = qcf.createQueueConnection();
            // 3. Create the session over the queue connection.
            QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            // 4. Create the sender to send messages over the session.
            QueueSender queueSender = queueSession.createSender(null);

            // When the onMessage method is called, a message has been sent.
            // You can retrieve attributes of the message using the Message object.
View Full Code Here

        Queue queue = (Queue) ctx.lookup(queueName);

        QueueConnection connection = factory.createQueueConnection();
        connection.start();

        QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        QueueSender sender = session.createSender(queue);
       
        TextMessage message = session.createTextMessage();
View Full Code Here

            javax.naming.Context ctx = new InitialContext(props);
            QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
            QueueConnection conn = factory.createQueueConnection();
            final Queue queue = (Queue) ctx.lookup("queueName");
            QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            QueueReceiver receiver = session.createReceiver(queue, selectors);
            System.out.println("Message Selector: " + receiver.getMessageSelector());
            receiver.setMessageListener(new MessageListener() {
                public void onMessage(Message message) {
                    try {
View Full Code Here

            javax.naming.Context ctx = new InitialContext(props);
            QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
            QueueConnection conn = factory.createQueueConnection();
            final Queue queue = (Queue) ctx.lookup("queueName");
            QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            QueueReceiver receiver = session.createReceiver(queue, selectors);
            System.out.println("Message Selector: " + receiver.getMessageSelector());
            receiver.setMessageListener(new MessageListener() {
                public void onMessage(Message message) {
                    try {
View Full Code Here

    public void testTryToReproduceNullPointerBug() throws Exception {
        String url = bindAddress;
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
        QueueConnection queueConnection = factory.createQueueConnection();
        this.connection = queueConnection;
        QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueSender sender = session.createSender(null); //Unidentified
        Queue receiverQueue = session.createTemporaryQueue();
        QueueReceiver receiver = session.createReceiver(receiverQueue);
        queueConnection.start();
    }
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.