Package javax.jms

Examples of javax.jms.Session.createTemporaryQueue()


            Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
            conn.start();

            //create Queues and consumers for each
            Queue namedQueue = sess.createQueue("vhostAccessCreatedQueue" + getTestQueueName());
            Queue tempQueue = sess.createTemporaryQueue();
            MessageConsumer consumer = sess.createConsumer(namedQueue);
            MessageConsumer tempConsumer = sess.createConsumer(tempQueue);

            //send a message to each queue (also causing an exchange declare)
            MessageProducer sender = ((AMQSession<?, ?>) sess).createProducer(null);
View Full Code Here


            Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

            conn.start();

            sess.createConsumer(sess.createTemporaryQueue());

            conn.close();
        }
        catch (Exception e)
        {
View Full Code Here

            ((org.apache.qpid.jms.MessageProducer) sender).send(queue, session.createTextMessage("test"),
                                                                DeliveryMode.NON_PERSISTENT, 0, 0L, false, false, true);

            // Test the connection with a valid consumer
            // This may fail as the session may be closed before the queue or the consumer created.
            Queue temp = session.createTemporaryQueue();

            session.createConsumer(temp).close();

            //Connection should now be closed and will throw the exception caused by the above send
            conn.close();
View Full Code Here

           
            Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

            conn.start();

            sess.createConsumer(sess.createTemporaryQueue());
           
            fail("Test failed as consumer was created.");
        }
        catch (JMSException e)
        {
View Full Code Here

            Connection conn = getConnection("test", "server", "guest");
            Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

            conn.start();

            session.createTemporaryQueue();

            fail("Test failed as creation succeded.");
        }
        catch (JMSException e)
        {
View Full Code Here

        Connection clientConnection = getConnection("test", "client", "guest");

        //Send a test mesage
        Session clientSession = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        Queue responseQueue = clientSession.createTemporaryQueue();

        MessageConsumer clientResponse = clientSession.createConsumer(responseQueue);

        clientConnection.start();
View Full Code Here

    public void testTemporaryQueue() throws Exception
    {
        Connection conn = createConnection();
        Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        TemporaryQueue queue = session.createTemporaryQueue();
        assertNotNull(queue);
        MessageProducer producer = session.createProducer(queue);
        MessageConsumer consumer = session.createConsumer(queue);
        conn.start();
        producer.send(session.createTextMessage("hello"));
View Full Code Here

    public void testQPID1217() throws Exception
    {
        Connection conA = getConnection();
        conA.setExceptionListener(this);
        Session sessA = conA.createSession(false, Session.AUTO_ACKNOWLEDGE);
        TemporaryQueue temp = sessA.createTemporaryQueue();
       
        MessageProducer prod = sessA.createProducer(temp);
        prod.send(sessA.createTextMessage("hi"));

        Thread.sleep(500);
View Full Code Here

            Map<String, Object> request = new TreeMap<String, Object>();
            request.put("args", new Object[]{"cheese"});

            // create a new temp response queue
            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            Destination responseQueue = session.createTemporaryQueue();

            // Create a request messages
            ObjectMessage requestMessage = session.createObjectMessage();
            requestMessage.setJMSReplyTo(responseQueue);
            requestMessage.setObject((Serializable) request);
View Full Code Here

            request.put("method", signature);
            request.put("args", args);

            // create a new temp response queue and consumer
            // this is very inefficient, but eliminates a whole class of errors
            Destination responseQueue = session.createTemporaryQueue();

            // Create a messages
            ObjectMessage requestMessage = session.createObjectMessage();
            requestMessage.setJMSReplyTo(responseQueue);
            String correlationId = UUID.randomUUID().toString();
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.