@Override public boolean isExpired(MessageReference messageReference) { return getNext().isExpired(messageReference); }
protected void doBrowseList(List<Message> browseList, int max, PendingList list, ReentrantReadWriteLock lock, ConnectionContext connectionContext, String name) throws Exception { List<MessageReference> toExpire = new ArrayList<MessageReference>(); lock.readLock().lock(); try { addAll(list.values(), browseList, max, toExpire); } finally { lock.readLock().unlock(); } for (MessageReference ref : toExpire) { if (broker.isExpired(ref)) { LOG.debug("expiring from {}: {}", name, ref); messageExpired(connectionContext, ref); } else { lock.writeLock().lock(); try { list.remove(ref); } finally { lock.writeLock().unlock(); } ref.decrementReferenceCount(); } } }
@Override public boolean recoverMessage(Message message) { recoveredAccumulator++; if ((recoveredAccumulator % 10000) == 0) { LOG.info("cursor for {} has recovered {} messages. {}% complete", new Object[]{ getActiveMQDestination().getQualifiedName(), recoveredAccumulator, new Integer((int) (recoveredAccumulator * 100 / totalMessageCount))}); } // Message could have expired while it was being // loaded.. message.setRegionDestination(Queue.this); if (message.isExpired() && broker.isExpired(message)) { toExpire.add(message); return true; } if (hasSpace()) { messagesLock.writeLock().lock(); try { try { messages.addMessageLast(message); } catch (Exception e) { LOG.error("Failed to add message to cursor", e); } } finally { messagesLock.writeLock().unlock(); } destinationStatistics.getMessages().increment(); return true; } return false; }
private void discardExpiredMessage(MessageReference reference) { LOG.debug("Discarding expired message {}", reference); if (reference.isExpired() && broker.isExpired(reference)) { ConnectionContext context = new ConnectionContext(); context.setBroker(broker); ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage())); } }
@Override public void afterCommit() throws Exception { // It could take while before we receive the commit // operation.. by that time the message could have // expired.. if (message.isExpired()) { if (broker.isExpired(message)) { getDestinationStatistics().getExpired().increment(); broker.messageExpired(context, message, null); } message.decrementReferenceCount(); return; } try { dispatch(context, message); } finally { message.decrementReferenceCount(); } }
if (broker.isExpired(ref)) { messageExpired(createConnectionContext(), ref); } else {
/** * Discard any expired messages from the matched list. Called from a * synchronized block. * * @throws IOException */ protected void removeExpiredMessages() throws IOException { try { matched.reset(); while (matched.hasNext()) { MessageReference node = matched.next(); node.decrementReferenceCount(); if (node.isExpired()) { matched.remove(); node.decrementReferenceCount(); if (broker.isExpired(node)) { ((Destination) node.getRegionDestination()).getDestinationStatistics().getExpired().increment(); broker.messageExpired(getContext(), node, this); } break; } } } finally { matched.release(); } }
if (broker.isExpired(node)) { regionDestination.messageExpired(context, this, node);
if (broker.isExpired(node)) { ((Destination)node.getRegionDestination()).messageExpired(context, this, node);
public boolean isExpired(MessageReference messageReference) { return next.isExpired(messageReference); }
@Override public boolean isExpired(MessageReference messageReference) { return getNext().isExpired(messageReference); }
@Override public boolean isExpired(MessageReference messageReference) { return getNext().isExpired(messageReference); }
@Override public boolean isExpired(MessageReference messageReference) { return getNext().isExpired(messageReference); }
public boolean isExpired(MessageReference messageReference) { return getNext().isExpired(messageReference); }
/** * In the queue case, mark the node as dropped and then a gc cycle will * remove it from the queue. * * @throws IOException */ protected void acknowledge(final ConnectionContext context, final MessageAck ack, final MessageReference n) throws IOException { final Destination q = n.getRegionDestination(); final QueueMessageReference node = (QueueMessageReference)n; final Queue queue = (Queue)q; if (n.isExpired()) { // sync with message expiry processing if (!broker.isExpired(n)) { LOG.warn("ignoring ack " + ack + ", for already expired message: " + n); return; } } queue.removeMessage(context, this, node, ack); }
private void discardExpiredMessage(MessageReference reference) { LOG.debug("Discarding expired message {}", reference); if (reference.isExpired() && broker.isExpired(reference)) { ConnectionContext context = new ConnectionContext(); context.setBroker(broker); ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage())); } }
private void discardExpiredMessage(MessageReference reference) { LOG.debug("Discarding expired message {}", reference); if (reference.isExpired() && broker.isExpired(reference)) { ConnectionContext context = new ConnectionContext(); context.setBroker(broker); ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage())); } }
private void discardExpiredMessage(MessageReference reference) { LOG.debug("Discarding expired message {}", reference); if (reference.isExpired() && broker.isExpired(reference)) { ConnectionContext context = new ConnectionContext(); context.setBroker(broker); ((Destination)reference.getRegionDestination()).messageExpired(context, null, new IndirectMessageReference(reference.getMessage())); } }
@Override public void afterCommit() throws Exception { // It could take while before we receive the commit // operration.. by that time the message could have // expired.. if (broker.isExpired(message)) { getDestinationStatistics().getExpired().increment(); broker.messageExpired(context, message, null); message.decrementReferenceCount(); return; } try { dispatch(context, message); } finally { message.decrementReferenceCount(); } } });
@Override public void afterCommit() throws Exception { // It could take while before we receive the commit // operation.. by that time the message could have // expired.. if (message.isExpired()) { if (broker.isExpired(message)) { getDestinationStatistics().getExpired().increment(); broker.messageExpired(context, message, null); } message.decrementReferenceCount(); return; } try { dispatch(context, message); } finally { message.decrementReferenceCount(); } }