Package javax.jms

Examples of javax.jms.Session.createTemporaryQueue()


        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


    private BrokerService broker = new BrokerService();

    public void testCreateTemporaryQueue() throws Exception {
        connection = createConnection();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Queue queue = session.createTemporaryQueue();
        assertTrue("No queue created!", queue != null);
        Topic topic = session.createTemporaryTopic();
        assertTrue("No topic created!", topic != null);
    }
View Full Code Here

        Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
        for (int i = 0; i < numberToCreate; i++) {
            if (i % 1000 == 0) {
                log.info("attempt " + i);
            }
            TemporaryQueue temporaryQueue = session.createTemporaryQueue();
            temporaryQueue.delete();
            Thread.sleep(sleep );
        }
        log.info("Created " + numberToCreate + " temporary queue(s)");
        connection.close();
View Full Code Here

        startAllBrokers();
        BrokerItem brokerItem=(BrokerItem) brokers.get("BrokerC");
        Connection conn=brokerItem.createConnection();
        conn.start();
        Session sess=conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
        TemporaryQueue tempQ=sess.createTemporaryQueue();
        Thread.sleep(5000);
        for(Iterator i=brokers.values().iterator();i.hasNext();){
            BrokerItem bi=(BrokerItem) i.next();
            assertEquals("No queues on broker "+bi.broker.getBrokerName(),1,bi.broker.getAdminView()
                            .getTemporaryQueues().length);
View Full Code Here

        startAllBrokers();
        BrokerItem brokerItem=(BrokerItem) brokers.get("BrokerC");
        Connection conn=brokerItem.createConnection();
        conn.start();
        Session sess=conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
        TemporaryQueue tempQ=sess.createTemporaryQueue();
        Thread.sleep(5000);
        for(Iterator i=brokers.values().iterator();i.hasNext();){
            BrokerItem bi=(BrokerItem) i.next();
            assertEquals("No queues on broker "+bi.broker.getBrokerName(),1,bi.broker.getAdminView()
                            .getTemporaryQueues().length);
View Full Code Here

      try
      {
         Connection conn = connectionFactory.createConnection();
         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        
         Queue replyTo = session.createTemporaryQueue();
         TextMessage msg = session.createTextMessage("Hello world");
         msg.setJMSReplyTo(replyTo);
        
         MessageConsumer consumer = session.createConsumer(replyTo);
         conn.start();
View Full Code Here

      try
      {
         Connection conn = connectionFactory.createConnection();
         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        
         Queue replyTo = session.createTemporaryQueue();
         TextMessage msg = session.createTextMessage("Hello world");
         msg.setJMSReplyTo(replyTo);
        
         MessageConsumer consumer = session.createConsumer(replyTo);
         conn.start();
View Full Code Here

   {
      ConnectionFactory connFactory = lookup("ConnectionFactory", ConnectionFactory.class);
      Connection conn = connFactory.createConnection();
      conn.start();
      Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      TemporaryQueue replyQueue = session.createTemporaryQueue();
      TextMessage msg = session.createTextMessage("Hello world");
      msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
      msg.setJMSReplyTo(replyQueue);
      Queue queue = lookup("queue/mdbtest", Queue.class);
      MessageProducer producer = session.createProducer(queue);
View Full Code Here

      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer sender = session.createProducer(queue);



      Queue temporaryQueue = session.createTemporaryQueue();
      MessageConsumer consumer = session.createConsumer(temporaryQueue);



      TextMessage message = session.createTextMessage("Hello!");
View Full Code Here

      {
         connection = cf.createConnection();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer sender = session.createProducer(queue);     
              
         Queue temporaryQueue = session.createTemporaryQueue();
         MessageConsumer consumer = session.createConsumer(temporaryQueue);           
        
         TextMessage message = session.createTextMessage("Hello!");
         message.setJMSReplyTo(temporaryQueue);           
        
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.