Package javax.jms

Examples of javax.jms.QueueSession.createReceiver()


                    queueConnection = connectionFactory.createQueueConnection( );
                    // create a transacted session
                    session = queueConnection.createQueueSession( TRANSACTED_RECEIVE, QueueSession.AUTO_ACKNOWLEDGE );
                    queue = session.createQueue(TEST_QUEUE_NAME);
                    receiver = session.createReceiver( queue );

                    // start the connection
                    queueConnection.start( );

                    logger.info( "Receiver " + Thread.currentThread().getName() + " connected." );
View Full Code Here


        QueueConnection connect = factory.createQueueConnection();

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

        receiver.setMessageListener(this);
       
    System.out.println("Listening for messages on titan-TicketQueue...");
        connect.start();
View Full Code Here

        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

        QueueConnection connect = factory.createQueueConnection();

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

        receiver.setMessageListener(this);
       
    System.out.println("Listening for messages on titan-TicketQueue...");
        connect.start();
View Full Code Here

        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();
    }

    public void testTemporaryQueueConsumer() throws Exception {
        final int number = 20;
View Full Code Here

                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) {
                            synchronized (count) {
                                count.notify();
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 {
                        if (message instanceof TextMessage) {
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 {
                        if (message instanceof TextMessage) {
View Full Code Here

        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();
    }

    public void testTemporaryQueueConsumer() throws Exception {
        final int NUMBER = 20;
View Full Code Here

                public void run() {
                    try {
                        QueueConnection connection = createConnection();
                        QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                        Queue queue = session.createTemporaryQueue();
                        QueueReceiver consumer = session.createReceiver(queue);
                        connection.start();
                       
                       
                        if (count.incrementAndGet() >= NUMBER){
                            synchronized(count){
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.