List of usage examples for com.amazonaws.services.sqs.model QueueAttributeName ApproximateNumberOfMessagesNotVisible
QueueAttributeName ApproximateNumberOfMessagesNotVisible
To view the source code for com.amazonaws.services.sqs.model QueueAttributeName ApproximateNumberOfMessagesNotVisible.
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;/*w w w . ja va2 s .co m*/ } log.debug("calculated size: {}", size); return size; }