Package org.hornetq.core.server

Examples of org.hornetq.core.server.Consumer


         }
        

         ConsumerHolder holder = consumerList.get(pos);

         Consumer consumer = holder.consumer;

         if (holder.iter == null)
         {
            holder.iter = messageReferences.iterator();
         }

         MessageReference ref;

         if (holder.iter.hasNext())
         {
            ref = holder.iter.next();
         }
         else
         {
            ref = null;
         }
        

         if (ref == null)
         {
            nullRefCount++;
         }
         else
         {
            if (checkExpired(ref))
            {
               if (isTrace)
               {
                  log.trace("Reference " + ref + " being expired");
               }
               holder.iter.remove();

               refRemoved(ref);
              
               handled++;

               continue;
            }

            Consumer groupConsumer = null;
           
            if (isTrace)
            {
               log.trace("Queue " + this.getName() + " is delivering reference " + ref);
            }
View Full Code Here


      while (true)
      {
         ConsumerHolder holder = consumerList.get(pos);

         Consumer consumer = holder.consumer;

         Consumer groupConsumer = null;

         // If a group id is set, then this overrides the consumer chosen round-robin

         SimpleString groupID = ref.getMessage().getSimpleStringProperty(Message.HDR_GROUP_ID);
View Full Code Here

   }

   public void testDeliveryScheduled() throws Exception
   {
      final CountDownLatch countDownLatch = new CountDownLatch(1);
      Consumer consumer = new FakeConsumer()
      {
         @Override
         public synchronized HandleStatus handle(final MessageReference reference)
         {
            countDownLatch.countDown();
View Full Code Here

      Assert.assertTrue(queue.isDurable());
   }

   public void testAddRemoveConsumer() throws Exception
   {
      Consumer cons1 = new FakeConsumer();

      Consumer cons2 = new FakeConsumer();

      Consumer cons3 = new FakeConsumer();

      QueueImpl queue = new QueueImpl(1,
                                      QueueImplTest.address1,
                                      QueueImplTest.queue1,
                                      null,
View Full Code Here

   }

   public void testDeliveryScheduled() throws Exception
   {
      final CountDownLatch countDownLatch = new CountDownLatch(1);
      Consumer consumer = new FakeConsumer()
      {
         @Override
         public synchronized HandleStatus handle(final MessageReference reference)
         {
            countDownLatch.countDown();
View Full Code Here

   public synchronized boolean hasMatchingConsumer(final ServerMessage message)
   {
      for (ConsumerHolder holder : consumerList)
      {
         Consumer consumer = holder.consumer;

         if (consumer instanceof Redistributor)
         {
            continue;
         }

         Filter filter = consumer.getFilter();

         if (filter == null)
         {
            return true;
         }
View Full Code Here

            return;
         }

         ConsumerHolder holder = consumerList.get(pos);

         Consumer consumer = holder.consumer;

         if (holder.iter == null)
         {
            holder.iter = messageReferences.iterator();
         }

         MessageReference ref;

         if (holder.iter.hasNext())
         {
            ref = holder.iter.next();
         }
         else
         {
            ref = null;
         }

         if (ref == null)
         {
            nullRefCount++;
         }
         else
         {
            if (checkExpired(ref))
            {
               holder.iter.remove();

               refRemoved(ref);

               continue;
            }

            Consumer groupConsumer = null;

            // If a group id is set, then this overrides the consumer chosen round-robin

            SimpleString groupID = ref.getMessage().getSimpleStringProperty(Message.HDR_GROUP_ID);
View Full Code Here

      while (true)
      {
         ConsumerHolder holder = consumerList.get(pos);

         Consumer consumer = holder.consumer;

         Consumer groupConsumer = null;

         // If a group id is set, then this overrides the consumer chosen round-robin

         SimpleString groupID = ref.getMessage().getSimpleStringProperty(Message.HDR_GROUP_ID);
View Full Code Here

   public synchronized boolean hasMatchingConsumer(final ServerMessage message)
   {
      for (ConsumerHolder holder : consumerList)
      {
         Consumer consumer = holder.consumer;

         if (consumer instanceof Redistributor)
         {
            continue;
         }

         Filter filter = consumer.getFilter();

         if (filter == null)
         {
            return true;
         }
View Full Code Here

               return;
            }

            ConsumerHolder holder = consumerList.get(pos);

            Consumer consumer = holder.consumer;

            if (holder.iter == null)
            {
               holder.iter = messageReferences.iterator();
            }

            MessageReference ref;

            if (holder.iter.hasNext())
            {
               ref = holder.iter.next();
            }
            else
            {
               ref = null;
            }

            if (ref == null)
            {
               nullRefCount++;
            }
            else
            {
               if (checkExpired(ref))
               {
                  if (isTrace)
                  {
                     log.trace("Reference " + ref + " being expired");
                  }
                  holder.iter.remove();

                  refRemoved(ref);

                  handled++;

                  continue;
               }

               Consumer groupConsumer = null;

               if (isTrace)
               {
                  log.trace("Queue " + this.getName() + " is delivering reference " + ref);
               }
View Full Code Here

TOP

Related Classes of org.hornetq.core.server.Consumer

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.