Package org.hornetq.core.server

Examples of org.hornetq.core.server.MessageReference


        
         DuplicateIDCache targetDuplicateCache = postOffice.getDuplicateIDCache(toAddress);
  
         while (iter.hasNext())
         {
            MessageReference ref = iter.next();
            if (filter == null || filter.match(ref.getMessage()))
            {
               boolean ignored = false;
              
               deliveringCount.incrementAndGet();
               count++;

               if (rejectDuplicates)
               {
                  byte [] duplicateBytes = ref.getMessage().getDuplicateIDBytes();
                  if (duplicateBytes != null)
                  {
                     if (targetDuplicateCache.contains(duplicateBytes))
                     {
                        log.info("Message with duplicate ID " + ref.getMessage().getDuplicateProperty() + " was already set at " + toAddress + ". Move from " + this.address + " being ignored and message removed from " + this.address);
                        acknowledge(tx, ref);
                        ignored = true;
                     }
                  }
               }
              
               if (!ignored)
               {
                  move(toAddress, tx, ref, false, rejectDuplicates);
               }
               iter.remove();
            }
         }
  
         List<MessageReference> cancelled = scheduledDeliveryHandler.cancel(filter);
         for (MessageReference ref : cancelled)
         {
            byte [] duplicateBytes = ref.getMessage().getDuplicateIDBytes();
            if (duplicateBytes != null)
            {
               if (targetDuplicateCache.contains(duplicateBytes))
               {
                  log.info("Message with duplicate ID " + ref.getMessage().getDuplicateProperty() + " was already set at " + toAddress + ". Move from " + this.address + " being ignored");
                  continue;
               }
            }
  
            deliveringCount.incrementAndGet();
View Full Code Here


   {
      Iterator<MessageReference> iter = iterator();

      while (iter.hasNext())
      {
         MessageReference ref = iter.next();
         if (ref.getMessage().getMessageID() == messageID)
         {
            iter.remove();
            refRemoved(ref);
            ref.getMessage().setPriority(newPriority);
            addTail(ref, false);
            return true;
         }
      }
View Full Code Here

      Iterator<MessageReference> iter = iterator();

      int count = 0;
      while (iter.hasNext())
      {
         MessageReference ref = iter.next();
         if (filter == null || filter.match(ref.getMessage()))
         {
            count++;
            iter.remove();
            refRemoved(ref);
            ref.getMessage().setPriority(newPriority);
            addTail(ref, false);
         }
      }
      return count;
   }
View Full Code Here

   }


   private synchronized void doPoll()
   {
      MessageReference ref = concurrentQueue.poll();

      if (ref != null)
      {
         internalAddTail(ref);
View Full Code Here

         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);

            if (groupID != null)
            {
               groupConsumer = groups.get(groupID);
View Full Code Here

      LinkedListIterator<MessageReference> iterator = iterator();

      try
      {

         MessageReference removed = null;

         while (iterator.hasNext())
         {
            MessageReference ref = iterator.next();

            if (ref.getMessage().getMessageID() == id)
            {
               iterator.remove();
               refRemoved(ref);

               removed = ref;
View Full Code Here

      try
      {

         while (iterator.hasNext())
         {
            MessageReference ref = iterator.next();

            if (ref.getMessage().getMessageID() == id)
            {
               return ref;
            }
         }
View Full Code Here

      try
      {

         while (iter.hasNext())
         {
            MessageReference ref = iter.next();

            if (filter == null || filter.match(ref.getMessage()))
            {
               deliveringCount.incrementAndGet();
               acknowledge(tx, ref);
               iter.remove();
               refRemoved(ref);
View Full Code Here

      try
      {

         while (iter.hasNext())
         {
            MessageReference ref = iter.next();
            if (ref.getMessage().getMessageID() == messageID)
            {
               deliveringCount.incrementAndGet();
               acknowledge(tx, ref);
               iter.remove();
               refRemoved(ref);
View Full Code Here

      try
      {

         while (iter.hasNext())
         {
            MessageReference ref = iter.next();
            if (ref.getMessage().getMessageID() == messageID)
            {
               deliveringCount.incrementAndGet();
               expire(ref);
               iter.remove();
               refRemoved(ref);
View Full Code Here

TOP

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

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.