Skip to content

Commit ad8b9f2

Browse files
Up SDK version to date & make WAIT_TIME_SECONDS modifiable
1 parent 7343e7d commit ad8b9f2

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ for communicating with Amazon Simple Queue Service. This project builds on top o
1515
<dependency>
1616
<groupId>com.amazonaws</groupId>
1717
<artifactId>amazon-sqs-java-messaging-lib</artifactId>
18-
<version>1.1.1</version>
18+
<version>1.1.2</version>
1919
<type>jar</type>
2020
</dependency>
2121
```

pom.xml

Lines changed: 4 additions & 4 deletions
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-messaging-lib</artifactId>
5-
<version>1.1.1</version>
5+
<version>1.1.2</version>
66
<name>Amazon SQS Java Messaging Library</name>
77
<description>The Amazon SQS Java Messaging Library holds the Java Message Service compatible classes, that are used
88
for communicating with Amazon Simple Queue Service.
@@ -29,7 +29,7 @@
2929
</developer>
3030
</developers>
3131
<properties>
32-
<aws-java-sdk.version>1.11.106</aws-java-sdk.version>
32+
<aws-java-sdk.version>1.12.360</aws-java-sdk.version>
3333
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3434
</properties>
3535

@@ -47,7 +47,7 @@
4747
<dependency>
4848
<groupId>org.junit.jupiter</groupId>
4949
<artifactId>junit-jupiter-engine</artifactId>
50-
<version>5.7.0-M1</version>
50+
<version>5.9.1</version>
5151
<scope>test</scope>
5252
</dependency>
5353
<dependency>
@@ -70,7 +70,7 @@
7070
<plugin>
7171
<groupId>org.apache.maven.plugins</groupId>
7272
<artifactId>maven-compiler-plugin</artifactId>
73-
<version>3.2</version>
73+
<version>3.10.1</version>
7474
<configuration>
7575
<source>1.7</source>
7676
<target>1.7</target>

src/main/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class SQSMessageConsumerPrefetch implements Runnable, PrefetchManager {
6060

6161
private static final Log LOG = LogFactory.getLog(SQSMessageConsumerPrefetch.class);
6262

63-
protected static final int WAIT_TIME_SECONDS = 20;
63+
protected static int WAIT_TIME_SECONDS = 20;
6464

6565
protected static final String ALL = "All";
6666

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
package com.amazon.sqs.javamessaging;
16+
17+
import org.junit.jupiter.api.DisplayName;
18+
import org.junit.jupiter.api.Test;
19+
20+
import java.lang.reflect.Field;
21+
22+
import static org.junit.jupiter.api.Assertions.assertEquals;
23+
24+
class ModifyWaitTimeSecondsTest {
25+
26+
@DisplayName("Should be able to modify SQSMessageConsumerPrefetch.WAIT_TIME_SECONDS via Reflection")
27+
@Test
28+
public void waitTimeSecondsShouldBeModifiableViaReflection() throws NoSuchFieldException, IllegalAccessException {
29+
Field wait_time_seconds = SQSMessageConsumerPrefetch.class.getDeclaredField("WAIT_TIME_SECONDS");
30+
wait_time_seconds.setAccessible(true);
31+
wait_time_seconds.setInt(null,5);
32+
assertEquals(5, SQSMessageConsumerPrefetch.WAIT_TIME_SECONDS);
33+
}
34+
}

0 commit comments

Comments
 (0)