Search in sources :

Example 31 with MessageInstance

use of org.apache.qpid.server.message.MessageInstance in project qpid-broker-j by apache.

the class AMQChannel method isDeliveredTooManyTimes.

private boolean isDeliveredTooManyTimes(final long deliveryTag) {
    final MessageInstance queueEntry = _unacknowledgedMessageMap.get(deliveryTag);
    if (queueEntry != null) {
        final int maximumDeliveryCount = queueEntry.getMaximumDeliveryCount();
        final int numDeliveries = queueEntry.getDeliveryCount();
        return maximumDeliveryCount != 0 && numDeliveries >= maximumDeliveryCount;
    }
    return false;
}
Also used : MessageInstance(org.apache.qpid.server.message.MessageInstance)

Aggregations

MessageInstance (org.apache.qpid.server.message.MessageInstance)31 Test (org.junit.Test)10 MessageInstanceConsumer (org.apache.qpid.server.message.MessageInstanceConsumer)8 ServerMessage (org.apache.qpid.server.message.ServerMessage)8 TestConsumerTarget (org.apache.qpid.server.consumer.TestConsumerTarget)5 MessageEnqueueRecord (org.apache.qpid.server.store.MessageEnqueueRecord)5 TransactionLogResource (org.apache.qpid.server.store.TransactionLogResource)5 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 LinkedHashMap (java.util.LinkedHashMap)4 AssertionFailedError (junit.framework.AssertionFailedError)4 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)4 Map (java.util.Map)3 Action (org.apache.qpid.server.util.Action)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 MessageDestination (org.apache.qpid.server.message.MessageDestination)2 MessageSource (org.apache.qpid.server.message.MessageSource)2 Queue (org.apache.qpid.server.model.Queue)2 Visitor (org.apache.qpid.server.protocol.v0_8.UnacknowledgedMessageMap.Visitor)2 MockMessageInstance (org.apache.qpid.server.queue.MockMessageInstance)2