Package javax.jms

Examples of javax.jms.Session.createTemporaryQueue()


            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


    private void sendReceiveTempQueueMessage(String broker) throws Exception {

      ConnectionFactory factory = getConnectionFactory(broker);
      Connection conn = factory.createConnection();
      Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      Destination dest = session.createTemporaryQueue();
      conn.close();
    }

    public void testTemporaryQueueAdvisory() throws Exception {
      LOG.info("Running testTemporaryQueueAdvisory()");
View Full Code Here

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

        ConnectionFactory replyFactory = getConnectionFactory("BrokerB");
        for (int i = 0; i < 500; i++) {
            TemporaryQueue tempDest = session.createTemporaryQueue();
            MessageProducer producer = session.createProducer(requestReplyDest);
            javax.jms.Message message = session.createTextMessage("req-" + i);
            message.setJMSReplyTo(tempDest);

            ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) session.createConsumer(tempDest);
View Full Code Here

        connection = connectionFactory.createConnection();

        connection.setClientID(clientID);
        connection.start();
        Session session = connection.createSession(transacted, authMode);
        ActiveMQTempQueue tQueue = (ActiveMQTempQueue) session.createTemporaryQueue();
        Thread.sleep(1000);
        ObjectName queueViewMBeanName = assertRegisteredObjectName(domain + ":Type="+  JMXSupport.encodeObjectNamePart(tQueue.getDestinationTypeAsString())+",Destination=" + JMXSupport.encodeObjectNamePart(tQueue.getPhysicalName()) + ",BrokerName=localhost");

        // should not throw an exception
        mbeanServer.getObjectInstance(queueViewMBeanName);
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

            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

    private Connection connection;
    private BrokerService broker;
   
    public void testBrokerStats() throws Exception{
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Queue replyTo = session.createTemporaryQueue();
        MessageConsumer consumer = session.createConsumer(replyTo);
        Queue query = session.createQueue(StatisticsBroker.STATS_BROKER_PREFIX);
        MessageProducer producer = session.createProducer(query);
        Message msg = session.createMessage();
        msg.setJMSReplyTo(replyTo);
View Full Code Here

       
    }
   
    public void testDestinationStats() throws Exception{
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Queue replyTo = session.createTemporaryQueue();
        MessageConsumer consumer = session.createConsumer(replyTo);
        Queue testQueue = session.createQueue("Test.Queue");
        MessageProducer producer = session.createProducer(null);
        Queue query = session.createQueue(StatisticsBroker.STATS_DESTINATION_PREFIX + testQueue.getQueueName());
        Message msg = session.createMessage();
View Full Code Here

       
    }

    public void testSubscriptionStats() throws Exception{
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Queue replyTo = session.createTemporaryQueue();
        MessageConsumer consumer = session.createConsumer(replyTo);
        Queue testQueue = session.createQueue("Test.Queue");
        MessageConsumer testConsumer = session.createConsumer(testQueue);
        MessageProducer producer = session.createProducer(null);
        Queue query = session.createQueue(StatisticsBroker.STATS_SUBSCRIPTION_PREFIX);
View Full Code Here

        Connection connection = cf.createConnection();
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        final TemporaryQueue queue = session.createTemporaryQueue();
        MessageConsumer consumer = session.createConsumer(queue);

        final Topic advisoryTopic = AdvisorySupport.getMessageConsumedAdvisoryTopic((ActiveMQDestination) queue);

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