@Override public int getDeliveryCount() { return ref.getDeliveryCount(); }
/** * @param ref * @param message */ private void deliverStandardMessage(final MessageReference ref, Message message) throws ActiveMQException { applyPrefixForLegacyConsumer(message); int packetSize = callback.sendMessage(ref, message, ServerConsumerImpl.this, ref.getDeliveryCount()); if (availableCredits != null) { availableCredits.addAndGet(-packetSize); if (logger.isTraceEnabled()) { logger.trace(this + "::FlowControl::delivery standard taking " + packetSize + " from credits, available now is " + availableCredits); } } }
@Override public void updateDeliveryCount(final MessageReference ref) throws Exception { // no need to store if it's the same value // otherwise the journal will get OME in case of lots of redeliveries if (ref.getDeliveryCount() == ref.getPersistedCount()) { return; } ref.setPersistedCount(ref.getDeliveryCount()); DeliveryCountUpdateEncoding updateInfo = new DeliveryCountUpdateEncoding(ref.getQueue().getID(), ref.getDeliveryCount()); readLock(); try { messageJournal.appendUpdateRecord(ref.getMessage().getMessageID(), JournalRecordIds.UPDATE_DELIVERY_COUNT, updateInfo, syncNonTransactional, getContext(syncNonTransactional)); } finally { readUnLock(); } }
int packetSize = callback.sendLargeMessage(ref, currentLargeMessage, ServerConsumerImpl.this, context.getLargeBodySize(), ref.getDeliveryCount());
rc.put(CompositeDataConstants.TIMESTAMP, new Date(m.getTimestamp())); rc.put(CompositeDataConstants.PRIORITY, m.getPriority()); rc.put(CompositeDataConstants.REDELIVERED, ref.getDeliveryCount() > 1);
int deliveryCount = reference.getDeliveryCount(); logger.trace("Sending reference " + reference + " to DLA = " + addressSettings.getDeadLetterAddress() + " since ref.getDeliveryCount=" + reference.getDeliveryCount() + "and maxDeliveries=" + maxDeliveries + " from queue=" + this.getName());
ReadableBuffer sendBuffer = message.getSendBuffer(messageReference.getDeliveryCount());
public static MessageDispatch createMessageDispatch(MessageReference reference, ICoreMessage message, WireFormat marshaller, AMQConsumer consumer) throws IOException { ActiveMQMessage amqMessage = toAMQMessage(reference, message, marshaller, consumer); //we can use core message id for sequenceId amqMessage.getMessageId().setBrokerSequenceId(message.getMessageID()); MessageDispatch md = new MessageDispatch(); md.setConsumerId(consumer.getId()); md.setRedeliveryCounter(reference.getDeliveryCount() - 1); md.setDeliverySequenceId(amqMessage.getMessageId().getBrokerSequenceId()); md.setMessage(amqMessage); ActiveMQDestination destination = amqMessage.getDestination(); md.setDestination(destination); return md; }
amqMsg.setRedeliveryCounter(reference.getDeliveryCount() - 1);