Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated visibility protection timeout option #3608

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks(final int numberO
}).when(s3Service).addS3Object(any(S3ObjectReference.class), any(AcknowledgementSet.class));
ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);
when(sqsOptions.getVisibilityTimeout()).thenReturn(Duration.ofSeconds(6));
when(sqsOptions.getMaxVisibilityTimeoutExtension()).thenReturn(Duration.ofSeconds(60));
when(sqsOptions.getVisibilityDuplicateProtectionTimeout()).thenReturn(Duration.ofSeconds(60));
when(sqsOptions.getVisibilityDuplicateProtection()).thenReturn(true);
acknowledgementSetManager = new DefaultAcknowledgementSetManager(executor);
final SqsWorker objectUnderTest = createObjectUnderTest();
Expand Down Expand Up @@ -419,7 +419,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks_expires(final int
}).when(s3Service).addS3Object(any(S3ObjectReference.class), any(AcknowledgementSet.class));
ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);
when(sqsOptions.getVisibilityTimeout()).thenReturn(Duration.ofSeconds(6));
when(sqsOptions.getMaxVisibilityTimeoutExtension()).thenReturn(Duration.ofSeconds(60));
when(sqsOptions.getVisibilityDuplicateProtectionTimeout()).thenReturn(Duration.ofSeconds(60));
when(sqsOptions.getVisibilityDuplicateProtection()).thenReturn(true);
acknowledgementSetManager = new DefaultAcknowledgementSetManager(executor);
final SqsWorker objectUnderTest = createObjectUnderTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ && isEventBridgeEventTypeCreated(parsedMessage)) {
List<DeleteMessageBatchRequestEntry> waitingForAcknowledgements = new ArrayList<>();
AcknowledgementSet acknowledgementSet = null;
final int visibilityTimeout = (int)sqsOptions.getVisibilityTimeout().getSeconds();
final int maxVisibilityTimeout = (int)sqsOptions.getMaxVisibilityTimeoutExtension().getSeconds();
final int maxVisibilityTimeout = (int)sqsOptions.getVisibilityDuplicateProtectionTimeout().getSeconds();
final int progressCheckInterval = visibilityTimeout/2 - 1;
if (endToEndAcknowledgementsEnabled) {
int expiryTimeout = visibilityTimeout - 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class SqsOptions {
private static final int DEFAULT_MAXIMUM_MESSAGES = 10;
private static final Boolean DEFAULT_VISIBILITY_DUPLICATE_PROTECTION = false;
private static final Duration DEFAULT_VISIBILITY_TIMEOUT_SECONDS = Duration.ofSeconds(30);
private static final Duration DEFAULT_MAX_VISIBILITY_TIMEOUT_EXTENSION = Duration.ofHours(2);
private static final Duration DEFAULT_VISIBILITY_DUPLICATE_PROTECTION_TIMEOUT = Duration.ofHours(2);
private static final Duration DEFAULT_WAIT_TIME_SECONDS = Duration.ofSeconds(20);
private static final Duration DEFAULT_POLL_DELAY_SECONDS = Duration.ofSeconds(0);

Expand All @@ -39,10 +39,10 @@ public class SqsOptions {
@JsonProperty("visibility_duplication_protection")
private Boolean visibilityDuplicateProtection = DEFAULT_VISIBILITY_DUPLICATE_PROTECTION;

@JsonProperty("maximum_visibility_timeout_extension")
@JsonProperty("visibility_duplicate_protection_timeout")
@DurationMin(seconds = 30)
@DurationMax(hours = 24)
private Duration maxVisibilityTimeoutExtension = DEFAULT_MAX_VISIBILITY_TIMEOUT_EXTENSION;
private Duration visibilityDuplicateProtectionTimeout = DEFAULT_VISIBILITY_DUPLICATE_PROTECTION_TIMEOUT;

@JsonProperty("wait_time")
@DurationMin(seconds = 0)
Expand All @@ -65,8 +65,8 @@ public Duration getVisibilityTimeout() {
return visibilityTimeout;
}

public Duration getMaxVisibilityTimeoutExtension() {
return maxVisibilityTimeoutExtension;
public Duration getVisibilityDuplicateProtectionTimeout() {
return visibilityDuplicateProtectionTimeout;
}

public Boolean getVisibilityDuplicateProtection() {
Expand Down
Loading