Package javax.jms

Examples of javax.jms.Session.createBrowser()


      if (_log.isTraceEnabled())
      {
         _log.trace("createBrowser " + Util.asString(session) + " queue=" + queue);
      }

      QueueBrowser result = session.createBrowser(queue);

      if (_log.isTraceEnabled())
      {
         _log.trace("createdBrowser " + Util.asString(session) + " browser=" + result);
      }
View Full Code Here


      if (_log.isTraceEnabled())
      {
         _log.trace("createBrowser " + Util.asString(session) + " queue=" + queue + " selector=" + messageSelector);
      }

      QueueBrowser result = session.createBrowser(queue, messageSelector);
      result = new QpidRAQueueBrowser(result, this);
      addQueueBrowser(result) ;

      if (_log.isTraceEnabled())
      {
View Full Code Here

     */
    protected List queryMessages(ActiveMQQueue queue, String selector) throws Exception {
        Connection conn = createConnection();

        Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueBrowser browser = sess.createBrowser(queue, selector);

        List messages = Collections.list(browser.getEnumeration());

        conn.close();

View Full Code Here

        // Get the first.
        assertEquals(outbound[0], consumer.receive(1000));
        consumer.close();
        //Thread.sleep(200);

        QueueBrowser browser = session.createBrowser((Queue) destination);
        Enumeration enumeration = browser.getEnumeration();

        // browse the second
        assertTrue("should have received the second message", enumeration.hasMoreElements());
        assertEquals(outbound[1], (Message) enumeration.nextElement());
View Full Code Here

        for (int i=0;i<outbound.length; i++) {
            producer.send(outbound[i]);
        }

        QueueBrowser browser = session.createBrowser((Queue) destination);
        Enumeration enumeration = browser.getEnumeration();

        for (int i=0; i<outbound.length; i++) {
            assertTrue("should have a", enumeration.hasMoreElements());
            assertEquals(outbound[i], enumeration.nextElement());
View Full Code Here

        for (int i=0;i<outbound.length; i++) {
            producer.send(outbound[i]);
        }

        // verify second batch is visible to browse
        browser = session.createBrowser((Queue) destination);
        enumeration = browser.getEnumeration();
        for (int j=0; j<2;j++) {
            for (int i=0; i<outbound.length; i++) {
                assertTrue("should have a", enumeration.hasMoreElements());
                assertEquals("j=" + j + ", i=" + i, outbound[i].getText(), ((TextMessage) enumeration.nextElement()).getText());
View Full Code Here

       
        MessageProducer producer = session.createProducer(destination);
        producer.send(outbound[0]);
       
        // create browser first
        QueueBrowser browser = session.createBrowser((Queue) destination);
        Enumeration enumeration = browser.getEnumeration();

        // browse the first message
        assertTrue("should have received the first message", enumeration.hasMoreElements());
        assertEquals(outbound[0], (Message) enumeration.nextElement());
View Full Code Here

        for (int i = 0; i < 1000; i++) {
            producer.send(session.createTextMessage("Message: "  + i));
        }

        QueueBrowser browser = session.createBrowser(destination);
        Enumeration enumeration = browser.getEnumeration();

        assertTrue(enumeration.hasMoreElements());

        int numberBrowsed = 0;
View Full Code Here

        for (int i=0; i<numMessages; i++) {
            TextMessage message = session.createTextMessage("Message: " + i);
            producer.send(message);  
        }
       
        QueueBrowser browser = session2.createBrowser(destinationPrefetch1);
        Enumeration<Message> browserView = browser.getEnumeration();
   
        List<Message> messages = new ArrayList<Message>();
        for (int i = 0; i < numMessages; i++) {
            Message m1 = consumer.receive(5000);
View Full Code Here

        producer.send(outbound[1]);
        producer.send(outbound[2]);


        // create browser first
        QueueBrowser browser = session.createBrowser((Queue) destination);
        Enumeration enumeration = browser.getEnumeration();


        // browse some messages
        assertEquals(outbound[0], (Message) enumeration.nextElement());
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.