|
10 | 10 | import java.util.function.Consumer; |
11 | 11 |
|
12 | 12 | import com.amazonaws.services.sqs.model.QueueNameExistsException; |
| 13 | +import com.amazonaws.services.sqs.model.TagQueueRequest; |
13 | 14 | import com.amazonaws.services.sqs.util.Constants; |
14 | 15 | import org.apache.commons.logging.Log; |
15 | 16 | import org.apache.commons.logging.LogFactory; |
@@ -185,13 +186,16 @@ public CreateQueueResult createQueue(CreateQueueRequest request) { |
185 | 186 | long currentTimestamp = System.currentTimeMillis(); |
186 | 187 | CreateQueueRequest superRequest = request.clone() |
187 | 188 | .withQueueName(queueName) |
188 | | - .withAttributes(attributes) |
189 | | - .addTagsEntry(IDLE_QUEUE_RETENTION_PERIOD_TAG, retentionPeriodString) |
190 | | - .addTagsEntry(LAST_HEARTBEAT_TIMESTAMP_TAG, String.valueOf(currentTimestamp)); |
| 189 | + .withAttributes(attributes); |
191 | 190 |
|
192 | 191 | CreateQueueResult result = super.createQueue(superRequest); |
193 | 192 | String queueUrl = result.getQueueUrl(); |
194 | 193 |
|
| 194 | + TagQueueRequest tagQueueRequest = new TagQueueRequest().withQueueUrl(queueUrl) |
| 195 | + .addTagsEntry(IDLE_QUEUE_RETENTION_PERIOD_TAG, retentionPeriodString) |
| 196 | + .addTagsEntry(LAST_HEARTBEAT_TIMESTAMP_TAG, String.valueOf(currentTimestamp)); |
| 197 | + amazonSqsToBeExtended.tagQueue(tagQueueRequest); |
| 198 | + |
195 | 199 | // TODO-RS: Filter more carefully to all attributes valid for createQueue |
196 | 200 | List<String> attributeNames = Arrays.asList(QueueAttributeName.ReceiveMessageWaitTimeSeconds.toString(), |
197 | 201 | QueueAttributeName.VisibilityTimeout.toString()); |
|
0 commit comments