Package org.apache.activemq.broker.region.cursors

Examples of org.apache.activemq.broker.region.cursors.OrderedPendingList


            pagedInMessagesLock.writeLock().lock();
            try {
                if(isPrioritizedMessages()) {
                    resultList = new PrioritizedPendingList();
                } else {
                    resultList = new OrderedPendingList();
                }
                for (QueueMessageReference ref : result) {
                    if (!pagedInMessages.containsKey(ref.getMessageId())) {
                        pagedInMessages.put(ref.getMessageId(), ref);
                        resultList.addMessageLast(ref);
                    } else {
                        ref.decrementReferenceCount();
                    }
                }
            } finally {
                pagedInMessagesLock.writeLock().unlock();
            }
        } else {
            // Avoid return null list, if condition is not validated
            resultList = new OrderedPendingList();
        }

        return resultList;
    }
View Full Code Here


        if (prioritizedMessages && this.pagedInPendingDispatch instanceof OrderedPendingList) {
            pagedInPendingDispatch = new PrioritizedPendingList();
            redeliveredWaitingDispatch = new PrioritizedPendingList();
        } else if(pagedInPendingDispatch instanceof PrioritizedPendingList) {
            pagedInPendingDispatch = new OrderedPendingList();
            redeliveredWaitingDispatch = new OrderedPendingList();
        }
    }
View Full Code Here

                if (sub instanceof QueueBrowserSubscription) {
                    ((QueueBrowserSubscription)sub).decrementQueueRef();
                    browserDispatches.remove(sub);
                }
                if (!redeliveredWaitingDispatch.isEmpty()) {
                    doDispatch(new OrderedPendingList());
                }
            } finally {
                consumersLock.writeLock().unlock();
            }
            if (!this.optimizedDispatch) {
View Full Code Here

            pagedInMessagesLock.writeLock().lock();
            try {
                if(isPrioritizedMessages()) {
                    resultList = new PrioritizedPendingList();
                } else {
                    resultList = new OrderedPendingList();
                }
                for (QueueMessageReference ref : result) {
                    if (!pagedInMessages.containsKey(ref.getMessageId())) {
                        pagedInMessages.put(ref.getMessageId(), ref);
                        resultList.addMessageLast(ref);
                    } else {
                        ref.decrementReferenceCount();
                        // store should have trapped duplicate in it's index, also cursor audit
                        // we need to remove the duplicate from the store in the knowledge that the original message may be inflight
                        // note: jdbc store will not trap unacked messages as a duplicate b/c it gives each message a unique sequence id
                        LOG.warn("{}, duplicate message {} paged in, is cursor audit disabled? Removing from store and redirecting to dlq", this, ref.getMessage());
                        if (store != null) {
                            ConnectionContext connectionContext = createConnectionContext();
                            store.removeMessage(connectionContext, new MessageAck(ref.getMessage(), MessageAck.POSION_ACK_TYPE, 1));
                            broker.getRoot().sendToDeadLetterQueue(connectionContext, ref.getMessage(), null, new Throwable("duplicate paged in from store for " + destination));
                        }
                    }
                }
            } finally {
                pagedInMessagesLock.writeLock().unlock();
            }
        } else {
            // Avoid return null list, if condition is not validated
            resultList = new OrderedPendingList();
        }

        return resultList;
    }
View Full Code Here

        if (prioritizedMessages && this.pagedInPendingDispatch instanceof OrderedPendingList) {
            pagedInPendingDispatch = new PrioritizedPendingList();
            redeliveredWaitingDispatch = new PrioritizedPendingList();
        } else if(pagedInPendingDispatch instanceof PrioritizedPendingList) {
            pagedInPendingDispatch = new OrderedPendingList();
            redeliveredWaitingDispatch = new OrderedPendingList();
        }
    }
View Full Code Here

                        }
                    }
                    redeliveredWaitingDispatch.addMessageLast(qmr);
                }
                if (!redeliveredWaitingDispatch.isEmpty()) {
                    doDispatch(new OrderedPendingList());
                }
            }finally {
                consumersLock.writeLock().unlock();
            }
            if (!(this.optimizedDispatch || isSlave())) {
View Full Code Here

            pagedInMessagesLock.writeLock().lock();
            try {
                if(isPrioritizedMessages()) {
                    resultList = new PrioritizedPendingList();
                } else {
                    resultList = new OrderedPendingList();
                }
                for (QueueMessageReference ref : result) {
                    if (!pagedInMessages.containsKey(ref.getMessageId())) {
                        pagedInMessages.put(ref.getMessageId(), ref);
                        resultList.addMessageLast(ref);
                    } else {
                        ref.decrementReferenceCount();
                    }
                }
            } finally {
                pagedInMessagesLock.writeLock().unlock();
            }
        } else {
            // Avoid return null list, if condition is not validated
            resultList = new OrderedPendingList();
        }

        return resultList;
    }
View Full Code Here

        PendingList rc;
        if(isPrioritizedMessages()) {
            rc = new PrioritizedPendingList();
        } else {
            rc = new OrderedPendingList();
        }

        Set<Subscription> fullConsumers = new HashSet<Subscription>(this.consumers.size());

        for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();) {
View Full Code Here

        if (prioritizedMessages && this.pagedInPendingDispatch instanceof OrderedPendingList) {
            pagedInPendingDispatch = new PrioritizedPendingList();
            redeliveredWaitingDispatch = new PrioritizedPendingList();
        } else if(pagedInPendingDispatch instanceof PrioritizedPendingList) {
            pagedInPendingDispatch = new OrderedPendingList();
            redeliveredWaitingDispatch = new OrderedPendingList();
        }
    }
View Full Code Here

                    ((QueueBrowserSubscription)sub).decrementQueueRef();
                    browserDispatches.remove(sub);
                }
                // AMQ-5107: don't resend if the broker is shutting down
                if (!redeliveredWaitingDispatch.isEmpty() && (! this.brokerService.isStopping())) {
                    doDispatch(new OrderedPendingList());
                }
            } finally {
                consumersLock.writeLock().unlock();
            }
            if (!this.optimizedDispatch) {
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.region.cursors.OrderedPendingList

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.