List of usage examples for com.amazonaws.services.sqs.model QueueAttributeName ApproximateNumberOfMessagesDelayed
QueueAttributeName ApproximateNumberOfMessagesDelayed
To view the source code for com.amazonaws.services.sqs.model QueueAttributeName ApproximateNumberOfMessagesDelayed.
Click Source Link
From source file:org.duracloud.common.queue.aws.SQSTaskQueue.java
License:Apache License
@Override public Integer sizeIncludingInvisibleAndDelayed() { GetQueueAttributesResult result = queryQueueAttributes(QueueAttributeName.ApproximateNumberOfMessages, QueueAttributeName.ApproximateNumberOfMessagesNotVisible, QueueAttributeName.ApproximateNumberOfMessagesDelayed); Map<String, String> attributes = result.getAttributes(); int size = 0; for (String attrKey : attributes.keySet()) { String value = attributes.get(attrKey); log.debug("retrieved attribute: {}={}", attrKey, value); int intValue = Integer.parseInt(value); size += intValue;// ww w. j a v a 2 s . com } log.debug("calculated size: {}", size); return size; }