-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into set-version-3.0.3
- Loading branch information
Showing
9 changed files
with
572 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ws-sqs/src/main/java/io/awspring/cloud/sqs/annotation/SqsListenerAcknowledgementMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2013-2023 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.awspring.cloud.sqs.annotation; | ||
|
||
import io.awspring.cloud.sqs.listener.acknowledgement.handler.AlwaysAcknowledgementHandler; | ||
import io.awspring.cloud.sqs.listener.acknowledgement.handler.NeverAcknowledgementHandler; | ||
import io.awspring.cloud.sqs.listener.acknowledgement.handler.OnSuccessAcknowledgementHandler; | ||
|
||
/** | ||
* Acknowledgement strategies supported by the {@link SqsListener} annotation. | ||
* | ||
* @author Joao Calassio | ||
* @since 3.1 | ||
* @see OnSuccessAcknowledgementHandler | ||
* @see AlwaysAcknowledgementHandler | ||
* @see NeverAcknowledgementHandler | ||
* @see io.awspring.cloud.sqs.listener.ContainerOptions | ||
* @see SqsListener | ||
*/ | ||
public class SqsListenerAcknowledgementMode { | ||
|
||
/** | ||
* Messages will be acknowledged when message processing is successful. | ||
*/ | ||
public static final String ON_SUCCESS = "ON_SUCCESS"; | ||
|
||
/** | ||
* Messages will be acknowledged whether processing was completed successfully or with an error. | ||
*/ | ||
public static final String ALWAYS = "ALWAYS"; | ||
|
||
/** | ||
* Messages will not be acknowledged automatically by the container. | ||
* @see io.awspring.cloud.sqs.listener.acknowledgement.Acknowledgement | ||
*/ | ||
public static final String MANUAL = "MANUAL"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...s/src/test/java/io/awspring/cloud/sqs/annotation/SqsListenerAcknowledgementModeTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2013-2023 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.awspring.cloud.sqs.annotation; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import io.awspring.cloud.sqs.listener.acknowledgement.handler.AcknowledgementMode; | ||
import java.lang.reflect.Field; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.EnumSource; | ||
|
||
/** | ||
* Tests for {@link SqsListenerAcknowledgementMode} enum values | ||
* | ||
* @author Joao Calassio | ||
*/ | ||
class SqsListenerAcknowledgementModeTests { | ||
|
||
@ParameterizedTest | ||
@EnumSource(AcknowledgementMode.class) | ||
void shouldHaveAllValuesOfAcknowledgementModeEnum(final AcknowledgementMode acknowledgementMode) | ||
throws NoSuchFieldException, IllegalAccessException { | ||
Class<SqsListenerAcknowledgementMode> clz = SqsListenerAcknowledgementMode.class; | ||
Field correspondingValue = clz.getDeclaredField(acknowledgementMode.name()); | ||
assertEquals(acknowledgementMode.name(), correspondingValue.get(clz)); | ||
} | ||
|
||
} |
Oops, something went wrong.