Skip to content

Commit

Permalink
Changed HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE value and removed static…
Browse files Browse the repository at this point in the history
… reference
  • Loading branch information
adam-aws committed Jun 17, 2020
1 parent 499bc0d commit ef59f4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AmazonSQSIdleQueueDeletingClient extends AbstractAmazonSQSClientWrapper {
public static final long MINIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS = 1;
public static final long MAXIMUM_IDLE_QUEUE_RETENTION_PERIOD_SECONDS = TimeUnit.MINUTES.toSeconds(5);
public static final long HEARTBEAT_INTERVAL_SECONDS_DEFAULT = 5;
public static final long HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE = 0;
public static final long HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE = 1;

static final String IDLE_QUEUE_RETENTION_PERIOD_TAG = "__IdleQueueRetentionPeriodSeconds";

Expand Down Expand Up @@ -115,10 +115,10 @@ public AmazonSQSIdleQueueDeletingClient(AmazonSQS sqs, String queueNamePrefix, L
this.queueNamePrefix = queueNamePrefix;

if (heartbeatIntervalSeconds != null) {
if (heartbeatIntervalSeconds <= HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE) {
if (heartbeatIntervalSeconds < HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE) {
throw new IllegalArgumentException("Heartbeat Interval Seconds: " +
heartbeatIntervalSeconds +
" must be bigger than " +
" must be equal to or bigger than " +
HEARTBEAT_INTERVAL_SECONDS_MIN_VALUE);
}
this.heartbeatIntervalSeconds = heartbeatIntervalSeconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import java.util.Optional;
import java.util.concurrent.TimeUnit;

import static com.amazonaws.services.sqs.AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;

public class AmazonSQSRequesterClientBuilder {

private Optional<AmazonSQS> customSQS = Optional.empty();
Expand All @@ -17,7 +15,7 @@ public class AmazonSQSRequesterClientBuilder {
private Map<String, String> queueAttributes = Collections.emptyMap();

private int idleQueueSweepingPeriod = 5;
private long queueHeartbeatInterval = HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
private long queueHeartbeatInterval = AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
private TimeUnit idleQueueSweepingTimeUnit = TimeUnit.MINUTES;

private AmazonSQSRequesterClientBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import java.util.Optional;

import static com.amazonaws.services.sqs.AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;

public class AmazonSQSResponderClientBuilder {

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

private String internalQueuePrefix = "__RequesterClientQueues__";
private long queueHeartbeatInterval = HEARTBEAT_INTERVAL_SECONDS_DEFAULT;
private long queueHeartbeatInterval = AmazonSQSIdleQueueDeletingClient.HEARTBEAT_INTERVAL_SECONDS_DEFAULT;

private AmazonSQSResponderClientBuilder() {
}
Expand Down

0 comments on commit ef59f4d

Please sign in to comment.