Skip to content

Commit 898366c

Browse files
authored
Add public constant class (#69)
1 parent 8345cdb commit 898366c

15 files changed

+64
-52
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Temporary queues are also automatically deleted if the clients that created them
2121
<dependency>
2222
<groupId>com.amazonaws</groupId>
2323
<artifactId>amazon-sqs-java-temporary-queues-client</artifactId>
24-
<version>1.2.1</version>
24+
<version>1.2.2</version>
2525
<type>jar</type>
2626
</dependency>
2727
```

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.amazonaws</groupId>
44
<artifactId>amazon-sqs-java-temporary-queues-client</artifactId>
5-
<version>1.2.1</version>
5+
<version>1.2.2</version>
66
<name>Amazon SQS Java Temporary Queues Client</name>
77
<description>An Amazon SQS client that supports creating lightweight, automatically-deleted temporary queues, for use in common messaging patterns such as Request/Response. See http://aws.amazon.com/sqs.</description>
88
<url>https://github.com/awslabs/amazon-sqs-java-temporary-queues-client</url>

src/main/java/com/amazonaws/services/sqs/AmazonSQSIdleQueueDeletingClient.java

+9-14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.function.Consumer;
1111

1212
import com.amazonaws.services.sqs.model.QueueNameExistsException;
13+
import com.amazonaws.services.sqs.util.Constants;
1314
import org.apache.commons.logging.Log;
1415
import org.apache.commons.logging.LogFactory;
1516

@@ -63,12 +64,6 @@ class AmazonSQSIdleQueueDeletingClient extends AbstractAmazonSQSClientWrapper {
6364

6465
private static final Log LOG = LogFactory.getLog(AmazonSQSIdleQueueDeletingClient.class);
6566

66-
// Publicly visible constants
67-
public static final String IDLE_QUEUE_RETENTION_PERIOD = "IdleQueueRetentionPeriodSeconds";
68-
public static final long MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS = 1;
69-
public static final long HEARTBEAT_INTERVAL_SECONDS_DEFAULT = 5;
70-
public static final long HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE = 1;
71-
7267
static final String IDLE_QUEUE_RETENTION_PERIOD_TAG = "__IdleQueueRetentionPeriodSeconds";
7368

7469
private static final String SWEEPING_QUEUE_DLQ_SUFFIX = "_DLQ";
@@ -111,15 +106,15 @@ public AmazonSQSIdleQueueDeletingClient(AmazonSQS sqs, String queueNamePrefix, L
111106
this.queueNamePrefix = queueNamePrefix;
112107

113108
if (heartbeatIntervalSeconds != null) {
114-
if (heartbeatIntervalSeconds < HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE) {
109+
if (heartbeatIntervalSeconds < Constants.HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE) {
115110
throw new IllegalArgumentException("Heartbeat Interval Seconds: " +
116111
heartbeatIntervalSeconds +
117112
" must be equal to or bigger than " +
118-
HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE);
113+
Constants.HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE);
119114
}
120115
this.heartbeatIntervalSeconds = heartbeatIntervalSeconds;
121116
} else {
122-
this.heartbeatIntervalSeconds = HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
117+
this.heartbeatIntervalSeconds = Constants.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
123118
}
124119
}
125120

@@ -201,7 +196,7 @@ public CreateQueueResult createQueue(CreateQueueRequest request) {
201196
List<String> attributeNames = Arrays.asList(QueueAttributeName.ReceiveMessageWaitTimeSeconds.toString(),
202197
QueueAttributeName.VisibilityTimeout.toString());
203198
Map<String, String> createdAttributes = amazonSqsToBeExtended.getQueueAttributes(queueUrl, attributeNames).getAttributes();
204-
createdAttributes.put(IDLE_QUEUE_RETENTION_PERIOD, retentionPeriodString);
199+
createdAttributes.put(Constants.IDLE_QUEUE_RETENTION_PERIOD, retentionPeriodString);
205200

206201
QueueMetadata metadata = new QueueMetadata(queueName, queueUrl, createdAttributes);
207202
queues.put(queueUrl, metadata);
@@ -214,15 +209,15 @@ public CreateQueueResult createQueue(CreateQueueRequest request) {
214209
}
215210

216211
static Optional<Long> getRetentionPeriod(Map<String, String> queueAttributes) {
217-
return Optional.ofNullable(queueAttributes.remove(IDLE_QUEUE_RETENTION_PERIOD))
212+
return Optional.ofNullable(queueAttributes.remove(Constants.IDLE_QUEUE_RETENTION_PERIOD))
218213
.map(Long::parseLong)
219214
.map(AmazonSQSIdleQueueDeletingClient::checkQueueRetentionPeriodBounds);
220215
}
221216

222217
static long checkQueueRetentionPeriodBounds(long retentionPeriod) {
223-
if (retentionPeriod < MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS) {
224-
throw new IllegalArgumentException("The " + IDLE_QUEUE_RETENTION_PERIOD +
225-
" attribute bigger or equal to " + MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS + " seconds");
218+
if (retentionPeriod < Constants.MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS) {
219+
throw new IllegalArgumentException("The " + Constants.IDLE_QUEUE_RETENTION_PERIOD +
220+
" attribute bigger or equal to " + Constants.MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS + " seconds");
226221
}
227222
return retentionPeriod;
228223
}

src/main/java/com/amazonaws/services/sqs/AmazonSQSRequesterClient.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.amazonaws.services.sqs.model.Message;
1616
import com.amazonaws.services.sqs.model.MessageAttributeValue;
1717
import com.amazonaws.services.sqs.model.SendMessageRequest;
18+
import com.amazonaws.services.sqs.util.Constants;
1819
import com.amazonaws.services.sqs.util.SQSMessageConsumer;
1920
import com.amazonaws.services.sqs.util.SQSQueueUtils;
2021

@@ -23,9 +24,6 @@
2324
* temporary queue for each response message.
2425
*/
2526
class AmazonSQSRequesterClient implements AmazonSQSRequester {
26-
27-
public static final String RESPONSE_QUEUE_URL_ATTRIBUTE_NAME = "ResponseQueueUrl";
28-
2927
private final AmazonSQS sqs;
3028
private final String queuePrefix;
3129
private final Map<String, String> queueAttributes;
@@ -70,7 +68,7 @@ public CompletableFuture<Message> sendMessageAndGetResponseAsync(SendMessageRequ
7068
String responseQueueUrl = sqs.createQueue(createQueueRequest).getQueueUrl();
7169

7270
SendMessageRequest requestWithResponseUrl = SQSQueueUtils.copyWithExtraAttributes(request,
73-
Collections.singletonMap(RESPONSE_QUEUE_URL_ATTRIBUTE_NAME,
71+
Collections.singletonMap(Constants.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME,
7472
new MessageAttributeValue().withDataType("String").withStringValue(responseQueueUrl)));
7573
// TODO-RS: Should be using sendMessageAsync
7674
sqs.sendMessage(requestWithResponseUrl);

src/main/java/com/amazonaws/services/sqs/AmazonSQSRequesterClientBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.amazonaws.services.sqs;
22

3+
import com.amazonaws.services.sqs.util.Constants;
4+
35
import java.util.Collections;
46
import java.util.HashMap;
57
import java.util.Map;
@@ -15,7 +17,7 @@ public class AmazonSQSRequesterClientBuilder {
1517
private Map<String, String> queueAttributes = Collections.emptyMap();
1618

1719
private int idleQueueSweepingPeriod = 5;
18-
private long queueHeartbeatInterval = AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
20+
private long queueHeartbeatInterval = Constants.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
1921
private TimeUnit idleQueueSweepingTimeUnit = TimeUnit.MINUTES;
2022
private long idleQueueRetentionPeriodSeconds = AmazonSQSTemporaryQueuesClientBuilder.IDLE_QUEUE_RETENTION_PERIOD_SECONDS_DEFAULT;
2123

src/main/java/com/amazonaws/services/sqs/AmazonSQSResponderClient.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.amazonaws.services.sqs;
22

3+
import com.amazonaws.services.sqs.util.Constants;
34
import org.apache.commons.logging.Log;
45
import org.apache.commons.logging.LogFactory;
56

@@ -24,7 +25,7 @@ public AmazonSQS getAmazonSQS() {
2425

2526
@Override
2627
public void sendResponseMessage(MessageContent request, MessageContent response) {
27-
MessageAttributeValue attribute = request.getMessageAttributes().get(AmazonSQSRequesterClient.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME);
28+
MessageAttributeValue attribute = request.getMessageAttributes().get(Constants.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME);
2829

2930
if (attribute != null) {
3031
String replyQueueUrl = attribute.getStringValue();
@@ -45,7 +46,7 @@ public void sendResponseMessage(MessageContent request, MessageContent response)
4546

4647
@Override
4748
public boolean isResponseMessageRequested(MessageContent requestMessage) {
48-
return requestMessage.getMessageAttributes().containsKey(AmazonSQSRequesterClient.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME);
49+
return requestMessage.getMessageAttributes().containsKey(Constants.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME);
4950
}
5051

5152
@Override

src/main/java/com/amazonaws/services/sqs/AmazonSQSResponderClientBuilder.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package com.amazonaws.services.sqs;
22

3+
import com.amazonaws.services.sqs.util.Constants;
4+
35
import java.util.Optional;
46

57
public class AmazonSQSResponderClientBuilder {
68

79
private Optional<AmazonSQS> customSQS = Optional.empty();
810

911
private String internalQueuePrefix = "__RequesterClientQueues__";
10-
private long queueHeartbeatInterval = AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
12+
private long queueHeartbeatInterval = Constants.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
1113

1214
private AmazonSQSResponderClientBuilder() {
1315
}

src/main/java/com/amazonaws/services/sqs/AmazonSQSTemporaryQueuesClient.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.amazonaws.services.sqs.model.CreateQueueResult;
1515
import com.amazonaws.services.sqs.model.QueueAttributeName;
1616
import com.amazonaws.services.sqs.util.AbstractAmazonSQSClientWrapper;
17+
import com.amazonaws.services.sqs.util.Constants;
1718
import com.amazonaws.services.sqs.util.SQSQueueUtils;
1819

1920
/**
@@ -124,14 +125,14 @@ public CreateQueueResult createQueue(CreateQueueRequest request) {
124125

125126
Map<String, String> extraQueueAttributes = new HashMap<>();
126127
// Add the retention period to both the host queue and each virtual queue
127-
extraQueueAttributes.put(AmazonSQSIdleQueueDeletingClient.IDLE_QUEUE_RETENTION_PERIOD, Long.toString(idleQueueRetentionPeriodSeconds));
128+
extraQueueAttributes.put(Constants.IDLE_QUEUE_RETENTION_PERIOD, Long.toString(idleQueueRetentionPeriodSeconds));
128129
String hostQueueUrl = hostQueueUrls.computeIfAbsent(request.getAttributes(), attributes -> {
129130
CreateQueueRequest hostQueueCreateRequest = SQSQueueUtils.copyWithExtraAttributes(request, extraQueueAttributes);
130131
hostQueueCreateRequest.setQueueName(prefix + '-' + hostQueueUrls.size());
131132
return amazonSqsToBeExtended.createQueue(hostQueueCreateRequest).getQueueUrl();
132133
});
133134

134-
extraQueueAttributes.put(AmazonSQSVirtualQueuesClient.VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE, hostQueueUrl);
135+
extraQueueAttributes.put(Constants.VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE, hostQueueUrl);
135136
// The host queue takes care of all the other queue attributes, so don't specify them when creating the virtual
136137
// queue or else the client may think we're trying to set them independently!
137138
CreateQueueRequest createVirtualQueueRequest = new CreateQueueRequest()

src/main/java/com/amazonaws/services/sqs/AmazonSQSVirtualQueuesClient.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.amazonaws.services.sqs.model.UntagQueueRequest;
2525
import com.amazonaws.services.sqs.model.UntagQueueResult;
2626
import com.amazonaws.services.sqs.util.AbstractAmazonSQSClientWrapper;
27+
import com.amazonaws.services.sqs.util.Constants;
2728
import com.amazonaws.services.sqs.util.DaemonThreadFactory;
2829
import com.amazonaws.services.sqs.util.ReceiveQueueBuffer;
2930
import com.amazonaws.services.sqs.util.SQSMessageConsumer;
@@ -49,7 +50,7 @@
4950
import java.util.concurrent.TimeoutException;
5051
import java.util.function.BiConsumer;
5152

52-
import static com.amazonaws.services.sqs.AmazonSQSIdleQueueDeletingClient.IDLE_QUEUE_RETENTION_PERIOD;
53+
import static com.amazonaws.services.sqs.util.Constants.IDLE_QUEUE_RETENTION_PERIOD;
5354

5455
/**
5556
* An AmazonSQS wrapper that adds support for "virtual" queues, which are logical
@@ -81,8 +82,6 @@ class AmazonSQSVirtualQueuesClient extends AbstractAmazonSQSClientWrapper {
8182

8283
private static final Log LOG = LogFactory.getLog(AmazonSQSVirtualQueuesClient.class);
8384

84-
public static final String VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE = "HostQueueUrl";
85-
8685
// This is just protection against bad logic that creates unbounded queues.
8786
public static final int MAXIMUM_VIRTUAL_QUEUES_COUNT = 1_000_000;
8887

@@ -154,13 +153,13 @@ private Optional<VirtualQueue> getVirtualQueue(String queueUrl) {
154153

155154
@Override
156155
public CreateQueueResult createQueue(CreateQueueRequest request) {
157-
String hostQueueUrl = request.getAttributes().get(VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE);
156+
String hostQueueUrl = request.getAttributes().get(Constants.VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE);
158157
if (hostQueueUrl == null) {
159158
return amazonSqsToBeExtended.createQueue(request);
160159
}
161160

162161
Map<String, String> attributes = new HashMap<>(request.getAttributes());
163-
attributes.remove(VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE);
162+
attributes.remove(Constants.VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE);
164163

165164
Optional<Long> retentionPeriod = AmazonSQSIdleQueueDeletingClient.getRetentionPeriod(attributes);
166165

@@ -341,7 +340,7 @@ public VirtualQueueID getID() {
341340
public GetQueueAttributesResult getQueueAttributes(GetQueueAttributesRequest request) {
342341
List<String> attributeNames = request.getAttributeNames();
343342
boolean includeHostQueue =
344-
attributeNames.remove(VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE) ||
343+
attributeNames.remove(Constants.VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE) ||
345344
attributeNames.contains("All");
346345
boolean includeRetentionPeriod = retentionPeriod.isPresent() &&
347346
(attributeNames.contains(IDLE_QUEUE_RETENTION_PERIOD) ||
@@ -352,7 +351,7 @@ public GetQueueAttributesResult getQueueAttributes(GetQueueAttributesRequest req
352351
.withAttributeNames(attributeNames);
353352
GetQueueAttributesResult result = amazonSqsToBeExtended.getQueueAttributes(hostQueueRequest);
354353
if (includeHostQueue) {
355-
result.getAttributes().put(VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE, hostQueue.queueUrl);
354+
result.getAttributes().put(Constants.VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE, hostQueue.queueUrl);
356355
}
357356
if (includeRetentionPeriod) {
358357
result.getAttributes().put(IDLE_QUEUE_RETENTION_PERIOD, retentionPeriod.get().toString());

src/main/java/com/amazonaws/services/sqs/AmazonSQSVirtualQueuesClientBuilder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.amazonaws.services.sqs;
22

33
import com.amazonaws.services.sqs.model.Message;
4+
import com.amazonaws.services.sqs.util.Constants;
45

56
import java.util.Optional;
67
import java.util.function.BiConsumer;
@@ -17,7 +18,7 @@ public class AmazonSQSVirtualQueuesClientBuilder {
1718

1819
private int maxWaitTimeSeconds = 20;
1920

20-
private long heartbeatIntervalSeconds = AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
21+
private long heartbeatIntervalSeconds = Constants.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
2122

2223
private AmazonSQSVirtualQueuesClientBuilder() {
2324
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.amazonaws.services.sqs.util;
2+
3+
public class Constants {
4+
public static final String RESPONSE_QUEUE_URL_ATTRIBUTE_NAME = "ResponseQueueUrl";
5+
public static final String VIRTUAL_QUEUE_HOST_QUEUE_ATTRIBUTE = "HostQueueUrl";
6+
public static final String IDLE_QUEUE_RETENTION_PERIOD = "IdleQueueRetentionPeriodSeconds";
7+
public static final long MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS = 1;
8+
public static final long HEARTBEAT_INTERVAL_SECONDS_DEFAULT = 5;
9+
public static final long HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE = 1;
10+
}

src/test/java/com/amazonaws/services/sqs/AmazonSQSIdleQueueDeletingIT.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.concurrent.TimeUnit;
77

88
import com.amazonaws.services.sqs.model.SendMessageRequest;
9+
import com.amazonaws.services.sqs.util.Constants;
910
import com.amazonaws.services.sqs.util.SQSMessageConsumerBuilder;
1011
import org.junit.After;
1112
import org.junit.Assert;
@@ -60,7 +61,7 @@ public void idleQueueIsDeleted() throws InterruptedException {
6061
client.startSweeper(requester, responder, 5, TimeUnit.SECONDS, exceptionHandler);
6162
CreateQueueRequest createQueueRequest = new CreateQueueRequest()
6263
.withQueueName(queueNamePrefix + "-IdleQueue")
63-
.addAttributesEntry(AmazonSQSIdleQueueDeletingClient.IDLE_QUEUE_RETENTION_PERIOD, "1");
64+
.addAttributesEntry(Constants.IDLE_QUEUE_RETENTION_PERIOD, "1");
6465
queueUrl = client.createQueue(createQueueRequest).getQueueUrl();
6566

6667
// May have to wait for up to a minute for the new queue to show up in ListQueues
@@ -72,7 +73,7 @@ public void idleQueueIsDeleted() throws InterruptedException {
7273
public void updatedHeartBeatTag() throws InterruptedException {
7374
CreateQueueRequest createQueueRequest = new CreateQueueRequest()
7475
.withQueueName(queueNamePrefix + "-HeartbeatTag")
75-
.addAttributesEntry(AmazonSQSIdleQueueDeletingClient.IDLE_QUEUE_RETENTION_PERIOD, "60");
76+
.addAttributesEntry(Constants.IDLE_QUEUE_RETENTION_PERIOD, "60");
7677
queueUrl = client.createQueue(createQueueRequest).getQueueUrl();
7778

7879
SendMessageRequest sendMsgRequest = new SendMessageRequest()
@@ -104,7 +105,7 @@ private String getLastHeartbeatTimestamp() {
104105
public void notUpdatedHeartBeatTag() throws InterruptedException {
105106
CreateQueueRequest createQueueRequest = new CreateQueueRequest()
106107
.withQueueName(queueNamePrefix + "-HeartbeatTag")
107-
.addAttributesEntry(AmazonSQSIdleQueueDeletingClient.IDLE_QUEUE_RETENTION_PERIOD, "60");
108+
.addAttributesEntry(Constants.IDLE_QUEUE_RETENTION_PERIOD, "60");
108109
queueUrl = client.createQueue(createQueueRequest).getQueueUrl();
109110

110111
SendMessageRequest sendMsgRequest = new SendMessageRequest()
@@ -128,7 +129,7 @@ public void recreatingQueues() throws InterruptedException {
128129
String queueName = queueNamePrefix + "-DeletedTooSoon";
129130
CreateQueueRequest createQueueRequest = new CreateQueueRequest()
130131
.withQueueName(queueName)
131-
.addAttributesEntry(AmazonSQSIdleQueueDeletingClient.IDLE_QUEUE_RETENTION_PERIOD, "60");
132+
.addAttributesEntry(Constants.IDLE_QUEUE_RETENTION_PERIOD, "60");
132133
queueUrl = client.createQueue(createQueueRequest).getQueueUrl();
133134

134135
QueueUser user = new QueueUser();

src/test/java/com/amazonaws/services/sqs/AmazonSQSRequesterClientTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import java.util.concurrent.TimeUnit;
1313
import java.util.concurrent.TimeoutException;
1414

15+
import com.amazonaws.services.sqs.util.Constants;
1516
import org.junit.After;
1617
import org.junit.Test;
1718

1819
import com.amazonaws.services.sqs.model.Message;
19-
import com.amazonaws.services.sqs.model.QueueDoesNotExistException;
2020
import com.amazonaws.services.sqs.model.SendMessageRequest;
2121
import com.amazonaws.services.sqs.util.ExceptionAsserter;
2222
import com.amazonaws.services.sqs.util.MockSQS;
@@ -59,7 +59,7 @@ public void happyPath() throws TimeoutException, InterruptedException, Execution
5959

6060
Message requestMessage = sqs.receiveMessage(queueUrl).getMessages().get(0);
6161
assertEquals(requestMessageBody, requestMessage.getBody());
62-
String responseQueueUrl = requestMessage.getMessageAttributes().get(AmazonSQSRequesterClient.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME).getStringValue();
62+
String responseQueueUrl = requestMessage.getMessageAttributes().get(Constants.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME).getStringValue();
6363
assertNotNull(responseQueueUrl);
6464

6565
responderClient.sendResponseMessage(MessageContent.fromMessage(requestMessage), new MessageContent(responseMessageBody));
@@ -84,7 +84,7 @@ public void timeout() throws TimeoutException, InterruptedException, ExecutionEx
8484

8585
Message requestMessage = sqs.receiveMessage(queueUrl).getMessages().get(0);
8686
assertEquals(requestMessageBody, requestMessage.getBody());
87-
String responseQueueUrl = requestMessage.getMessageAttributes().get(AmazonSQSRequesterClient.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME).getStringValue();
87+
String responseQueueUrl = requestMessage.getMessageAttributes().get(Constants.RESPONSE_QUEUE_URL_ATTRIBUTE_NAME).getStringValue();
8888
assertNotNull(responseQueueUrl);
8989

9090
// TODO-RS: Junit 5

0 commit comments

Comments
 (0)