/** * @return the number of messages expired by this destination */ public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
@Override public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
@Override public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) { LOG.debug("message expired: {}", reference); broker.messageExpired(context, reference, subs); destinationStatistics.getExpired().increment(); try { removeMessage(context, subs, (QueueMessageReference) reference); messagesLock.writeLock().lock(); try { messages.rollback(reference.getMessageId()); } finally { messagesLock.writeLock().unlock(); } } catch (IOException e) { LOG.error("Failed to remove expired Message from the store ", e); } }
@Override public void messageExpired(ConnectionContext context, Subscription subs, MessageReference reference) { broker.messageExpired(context, reference, subs); // AMQ-2586: Better to leave this stat at zero than to give the user // misleading metrics. // destinationStatistics.getMessages().decrement(); destinationStatistics.getExpired().increment(); MessageAck ack = new MessageAck(); ack.setAckType(MessageAck.STANDARD_ACK_TYPE); ack.setDestination(destination); ack.setMessageID(reference.getMessageId()); try { if (subs instanceof DurableTopicSubscription) { ((DurableTopicSubscription)subs).removePending(reference); } acknowledge(context, subs, ack, reference); } catch (Exception e) { LOG.error("Failed to remove expired Message from the store ", e); } }
@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(); } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
/** * 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(); } }
LOG.error("message expired waiting for space"); broker.messageExpired(context, message, null); destinationStatistics.getExpired().increment(); } else { doMessageSend(producerExchangeCopy, message);
getDestinationStatistics().getExpired().increment(); if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message.getSize()); getDestinationStatistics().getExpired().increment(); LOG.debug("Expired message: {}", message); return;
@Override public void run() { try { // While waiting for space to free up... the // message may have expired. if (message.isExpired()) { broker.messageExpired(context, message, null); getDestinationStatistics().getExpired().increment(); } else { doMessageSend(producerExchange, message); } if (sendProducerAck) { ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message .getSize()); context.getConnection().dispatchAsync(ack); } else { Response response = new Response(); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } catch (Exception e) { if (!sendProducerAck && !context.isInRecoveryMode()) { ExceptionResponse response = new ExceptionResponse(e); response.setCorrelationId(message.getCommandId()); context.getConnection().dispatchAsync(response); } } } });
statsMessage.setLong("dequeueCount", stats.getDequeues().getCount()); statsMessage.setLong("dispatchCount", stats.getDispatched().getCount()); statsMessage.setLong("expiredCount", stats.getExpired().getCount()); statsMessage.setLong("inflightCount", stats.getInflight().getCount()); statsMessage.setLong("messagesCached", stats.getMessagesCached().getCount()); statsMessage.setLong("dequeueCount", stats.getDequeues().getCount()); statsMessage.setLong("dispatchCount", stats.getDispatched().getCount()); statsMessage.setLong("expiredCount", stats.getExpired().getCount()); statsMessage.setLong("inflightCount", stats.getInflight().getCount());
/** * @return the number of messages expired by this destination */ public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
/** * @return the number of messages expired by this destination */ public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
@Override public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
/** * @return the number of messages expired by this destination */ public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
@Override public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
@Override public long getExpiredCount() { return destination.getDestinationStatistics().getExpired().getCount(); }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }
private void incrementStatsOnAck(final Destination destination, final MessageAck ack, final int count) { getSubscriptionStatistics().getDequeues().add(count); destination.getDestinationStatistics().getDequeues().add(count); destination.getDestinationStatistics().getInflight().subtract(count); if (info.isNetworkSubscription()) { destination.getDestinationStatistics().getForwards().add(count); } if (ack.isExpiredAck()) { destination.getDestinationStatistics().getExpired().add(count); } }