Package javax.jms

Examples of javax.jms.QueueBrowser


            getDelegate()).getRemotingConnection();
         rc.removeConnectionListener();

         Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);

         QueueBrowser browser = session1.createBrowser(queue[1]);

         ServerManagement.kill(1);

         browser.close();
      }
      finally
      {
         if (conn1 != null)
         {
View Full Code Here


      if (HornetQRASession.trace)
      {
         HornetQRASession.log.trace("createBrowser " + session + " queue=" + queue);
      }

      QueueBrowser result = session.createBrowser(queue);

      if (HornetQRASession.trace)
      {
         HornetQRASession.log.trace("createdBrowser " + session + " browser=" + result);
      }
View Full Code Here

      if (HornetQRASession.trace)
      {
         HornetQRASession.log.trace("createBrowser " + session + " queue=" + queue + " selector=" + messageSelector);
      }

      QueueBrowser result = session.createBrowser(queue, messageSelector);

      if (HornetQRASession.trace)
      {
         HornetQRASession.log.trace("createdBrowser " + session + " browser=" + result);
      }
View Full Code Here

         prod.send(m);

         // Give the message time to reach the queue
         Thread.sleep(2000);

         QueueBrowser browser = session.createBrowser(HornetQServerTestCase.queue1);

         Enumeration e = browser.getEnumeration();

         TextMessage bm = (TextMessage)e.nextElement();

         ProxyAssertSupport.assertEquals("message one", bm.getText());
      }
View Full Code Here

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

         MessageProducer producer = session.createProducer(HornetQServerTestCase.queue1);

         QueueBrowser browser = session.createBrowser(HornetQServerTestCase.queue1);

         ProxyAssertSupport.assertEquals(browser.getQueue(), HornetQServerTestCase.queue1);

         ProxyAssertSupport.assertNull(browser.getMessageSelector());

         Enumeration<Message> en = (Enumeration<Message>)browser.getEnumeration();

         conn.start();

         Message m = session.createMessage();
         m.setIntProperty("cnt", 0);
View Full Code Here

         Message m = session.createTextMessage("A");
         producer.send(m);

         // make sure we can browse it

         QueueBrowser browser = session.createBrowser(HornetQServerTestCase.queue1);

         Enumeration en = browser.getEnumeration();

         ProxyAssertSupport.assertTrue(en.hasMoreElements());

         TextMessage rm = (TextMessage)en.nextElement();

         ProxyAssertSupport.assertNotNull(rm);
         ProxyAssertSupport.assertEquals("A", rm.getText());

         ProxyAssertSupport.assertFalse(en.hasMoreElements());

         // create a *new* enumeration, that should reset it

         en = browser.getEnumeration();

         ProxyAssertSupport.assertTrue(en.hasMoreElements());

         rm = (TextMessage)en.nextElement();

View Full Code Here

     * @throws javax.jms.JMSException - if there is a problem creating the consumer
     */
    public void testSubscriptionCreateQueueBrowser() throws JMSException, IOException
    {
        _connection.start();
        QueueBrowser browser = _session.createBrowser(_queue);

        browser.getEnumeration();
        //Validate
        //Ensure that we wait for the SUB log message
        waitAndFindMatches("SUB-1001");

        List<String> results = findMatches(SUB_PREFIX);
View Full Code Here

        try {
            ActiveMQConnectionFactory connFac = new ActiveMQConnectionFactory(url);
            Connection conn = connFac.createConnection();
            conn.start();
            Session session = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
            QueueBrowser browser = session.createBrowser(queue, "accountNumber = '" + accountNumber + "'");
            Enumeration msgs = browser.getEnumeration();
            if (msgs.hasMoreElements()) {
                MapMessage msg = (MapMessage)msgs.nextElement();
                float balance = msg.getFloat("balance");
                conn.close();
                return balance;
View Full Code Here

            Queue queue = (Queue) getDestination(portletRequest, jmsDestinationInfo);
            List<JMSMessageInfo> messages = new LinkedList<JMSMessageInfo>();
            connection = connectionFactory.createConnection();
            connection.start();
            Session session = connection.createSession(false, QueueSession.AUTO_ACKNOWLEDGE);
            QueueBrowser qBrowser = session.createBrowser(queue);
            for (Enumeration e = qBrowser.getEnumeration(); e.hasMoreElements();) {
                Message message = (Message) e.nextElement();
                JMSMessageInfo messageInfo = new JMSMessageInfo();
                messageInfo.setPriority(message.getJMSPriority());
                messageInfo.setMessageId(message.getJMSMessageID());
                messageInfo.setDestination(message.getJMSDestination().toString());
View Full Code Here

        if (acknowledgeMode == Session.SESSION_TRANSACTED)
        {
            _producerSession.commit();
        }

        QueueBrowser browser = _consumerSession.createBrowser((Queue) _destination);
        return browser;
    }
View Full Code Here

TOP

Related Classes of javax.jms.QueueBrowser

Copyright © 2018 www.massapicom. 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.