Package org.jboss.jms.client

Examples of org.jboss.jms.client.JBossConnectionConsumer


      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
      return new JBossConnectionConsumer((ConnectionDelegate)mi.getTargetObject(), dest,
                                         subscriptionName, messageSelector, sessionPool,
                                         maxMessages);
   }
View Full Code Here


         sessCons.setMessageListener(listener);

         ServerSessionPool pool = new MockServerSessionPool(sessCons);

         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConsumer.createConnectionConsumer(queue, null, pool, 1);

         connProducer = cf.createConnection();

         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue);

         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            TextMessage m = sessProd.createTextMessage("testing testing");
            prod.send(m);
         }

         //Wait for messages

         listener.waitForLatch(10000);

         if (listener.getMsgsReceived() != NUM_MESSAGES)
         {
            fail("Didn't receive all messages");
         }

         if (listener.failed)
         {
            fail ("Didn't receive correct messages");
         }

         log.trace("Received all messages");

         log.trace("closing connection consumer ...");

         cc.close();

         log.trace("closing connections ...");

         connProducer.close();
         connProducer = null;
View Full Code Here

        
         sessCons.setMessageListener(listener);
        
         ServerSessionPool pool = new MockServerSessionPool(sessCons);
        
         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConsumer.createConnectionConsumer(queue, null, pool, 1);        
        
         log.trace("Started connection consumer");
        
         connProducer = cf.createConnection();
           
         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue);
           
         TextMessage m1 = sessProd.createTextMessage("a");
         TextMessage m2 = sessProd.createTextMessage("b");
         TextMessage m3 = sessProd.createTextMessage("c");
         prod.send(m1);
         prod.send(m2);
         prod.send(m3);
        
        
         log.trace("Sent messages");
        
         //Wait for messages
        
         listener.waitForLatch(10000);                 
        
         if (listener.failed)
         {
            fail ("Didn't receive correct messages");
         }
        
         cc.close();
        
         log.trace("Closed connection consumer");
        
         connProducer.close();
         connProducer = null;
View Full Code Here

        
         connConnectionConsumer = cf.createConnection();
        
         connConnectionConsumer.start();
        
         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConnectionConsumer.createConnectionConsumer(queue, null, pool, 1);        
        
         log.trace("Started connection consumer");
        
         connProducer = cf.createConnection();
           
         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue);
           
         TextMessage m1 = sessProd.createTextMessage("a");
         TextMessage m2 = sessProd.createTextMessage("b");
         TextMessage m3 = sessProd.createTextMessage("c");
         prod.send(m1);
         prod.send(m2);
         prod.send(m3);
        
        
         log.trace("Sent messages");
        
         //Wait for messages
        
         listener.waitForLatch(10000);                 
        
         if (listener.failed)
         {
            fail ("Didn't receive correct messages");
         }
        
         cc.close();
        
         log.trace("Closed connection consumer");
        
         connProducer.close();
         connProducer = null;
View Full Code Here

         sessCons.setMessageListener(listener);

         ServerSessionPool pool = new MockServerSessionPool(sessCons);

         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConsumer.createConnectionConsumer(queue, null, pool, 1);

         log.trace("Started connection consumer");

         connProducer = cf.createConnection();

         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue);

         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            TextMessage m = sessProd.createTextMessage("testing testing");
            prod.send(m);
         }

         log.trace("Sent messages");


         cc.close();

         connProducer.close();
         connProducer = null;
         connConsumer.close();
         connConsumer = null;
View Full Code Here

      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
      return new JBossConnectionConsumer((ConnectionDelegate)mi.getTargetObject(), dest,
                                         subscriptionName, messageSelector, sessionPool,
                                         maxMessages);
   }
View Full Code Here

      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
      return new JBossConnectionConsumer((ConnectionDelegate)mi.getTargetObject(), dest,
                                         subscriptionName, messageSelector, sessionPool,
                                         maxMessages);
   }
View Full Code Here

         sessCons.setMessageListener(listener);

         ServerSessionPool pool = new MockServerSessionPool(sessCons);

         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConsumer.createConnectionConsumer(queue1, null, pool, 1);

         connProducer = cf.createConnection();

         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue1);

         forceGC();
        
         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            TextMessage m = sessProd.createTextMessage("testing testing");
            prod.send(m);
         }

         //Wait for messages

         listener.waitForLatch(10000);

         if (listener.getMsgsReceived() != NUM_MESSAGES)
         {
            fail("Didn't receive all messages");
         }

         if (listener.failed)
         {
            fail ("Didn't receive correct messages");
         }

         cc.close();

         connProducer.close();
         connProducer = null;
         connConsumer.close();
         connConsumer = null;
View Full Code Here

        
         sessCons.setMessageListener(listener);
        
         ServerSessionPool pool = new MockServerSessionPool(sessCons);
        
         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConsumer.createConnectionConsumer(queue1, null, pool, 1);        
        
         connProducer = cf.createConnection();
           
         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue1);
           
         TextMessage m1 = sessProd.createTextMessage("a");
         TextMessage m2 = sessProd.createTextMessage("b");
         TextMessage m3 = sessProd.createTextMessage("c");
         prod.send(m1);
         prod.send(m2);
         prod.send(m3);
           
         //Wait for messages
        
         listener.waitForLatch(10000);                 
        
         if (listener.failed)
         {
            fail ("Didn't receive correct messages");
         }
        
         cc.close();
        
         connProducer.close();
         connProducer = null;
         connConsumer.close();
         connConsumer = null;           
View Full Code Here

        
         connConnectionConsumer = cf.createConnection();
        
         connConnectionConsumer.start();
        
         JBossConnectionConsumer cc = (JBossConnectionConsumer)connConnectionConsumer.createConnectionConsumer(queue1, null, pool, 1);        
        
         connProducer = cf.createConnection();
           
         Session sessProd = connProducer.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer prod = sessProd.createProducer(queue1);
           
         TextMessage m1 = sessProd.createTextMessage("a");
         TextMessage m2 = sessProd.createTextMessage("b");
         TextMessage m3 = sessProd.createTextMessage("c");
         prod.send(m1);
         prod.send(m2);
         prod.send(m3);
         
         //Wait for messages
        
         listener.waitForLatch(10000);                 
        
         if (listener.failed)
         {
            fail ("Didn't receive correct messages");
         }
        
         cc.close();
          
         connProducer.close();
         connProducer = null;
         connConsumer.close();
         connConsumer = null;
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.JBossConnectionConsumer

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.