queueUrl = qUrl;
break;
}
}
if (queueUrl == null) {
CreateQueueRequest request = new CreateQueueRequest(queueName);
Map<String, String> queueAttributes = new HashMap<String, String>();
queueAttributes.put("ReceiveMessageWaitTimeSeconds", Integer
.valueOf(receiveMessageWaitTimeout).toString());
if (messageDelay != null) {
queueAttributes.put("DelaySeconds", messageDelay.toString());
}
if (maximumMessageSize != null) {
queueAttributes.put("MaximumMessageSize",
maximumMessageSize.toString());
}
if (messageRetentionPeriod != null) {
queueAttributes.put("MessageRetentionPeriod",
messageRetentionPeriod.toString());
}
if (visibilityTimeout != null) {
queueAttributes.put("VisibilityTimeout",
visibilityTimeout.toString());
}
request.setAttributes(queueAttributes);
CreateQueueResult result = sqsClient.createQueue(request);
queueUrl = result.getQueueUrl();
log.debug("New queue available at: " + queueUrl);
} else {
log.debug("Queue already exists: " + queueUrl);