Skip to content

Commit 0098603

Browse files
Add Retry annotation (#139)
1 parent fc75a74 commit 0098603

File tree

4 files changed

+84
-2
lines changed

4 files changed

+84
-2
lines changed

mvnBuildFunctionPluginsSkipTests.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mvn clean install -pl build-tools,azure-maven-plugins-pom,azure-tools-common,azure-maven-plugin-lib,azure-functions-maven-plugin -Dmaven.javadoc.skip=true -Dmaven.test.skip -U -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B
1+
mvn clean install -pl build-tools,azure-maven-plugins-pom,azure-tools-common,azure-auth-helper,azure-maven-plugin-lib,azure-functions-maven-plugin -Dmaven.javadoc.skip=true -Dmaven.test.skip -U -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.microsoft.azure.functions</groupId>
66
<artifactId>azure-functions-java-library</artifactId>
7-
<version>1.4.1-SNAPSHOT</version>
7+
<version>1.4.2-SNAPSHOT</version>
88
<packaging>jar</packaging>
99
<parent>
1010
<groupId>com.microsoft.maven</groupId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for
4+
* license information.
5+
*/
6+
7+
package com.microsoft.azure.functions.annotation;
8+
9+
import java.lang.annotation.ElementType;
10+
import java.lang.annotation.Retention;
11+
import java.lang.annotation.RetentionPolicy;
12+
import java.lang.annotation.Target;
13+
14+
/**
15+
* <p>
16+
* Defines an exponential backoff retry strategy, where the delay between retries
17+
* will get progressively larger, limited by the max/min specified.</p>
18+
*
19+
* @since 1.0.0
20+
*/
21+
@Retention(RetentionPolicy.RUNTIME)
22+
@Target(ElementType.METHOD)
23+
public @interface ExponentialBackoffRetry {
24+
/**
25+
* The strategy of retries that will be used internally.
26+
* @return The strategy of retries.
27+
*/
28+
String strategy() default "exponentialBackoff";
29+
/**
30+
* The maximum number of retries that will be attempted.
31+
* @return The maximum retry count.
32+
*/
33+
int maxRetryCount();
34+
/**
35+
* The minimum delay interval.
36+
* @return The minimum retry delay.
37+
*/
38+
String minimumInterval();
39+
/**
40+
* The maximum delay interval.
41+
* @return The maximum retry delay.
42+
*/
43+
String maximumInterval();
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for
4+
* license information.
5+
*/
6+
7+
package com.microsoft.azure.functions.annotation;
8+
9+
import java.lang.annotation.ElementType;
10+
import java.lang.annotation.Retention;
11+
import java.lang.annotation.RetentionPolicy;
12+
import java.lang.annotation.Target;
13+
14+
/**
15+
* <p>
16+
* Defines a retry strategy where a fixed delay is used between retries.</p>
17+
*
18+
* @since 1.0.0
19+
*/
20+
@Retention(RetentionPolicy.RUNTIME)
21+
@Target(ElementType.METHOD)
22+
public @interface FixedDelayRetry {
23+
/**
24+
* The strategy of retries that will be used internally.
25+
* @return The strategy of retries.
26+
*/
27+
String strategy() default "fixedDelay";
28+
/**
29+
* The maximum number of retries that will be attempted.
30+
* @return The delay between retries.
31+
*/
32+
int maxRetryCount();
33+
/**
34+
* The delay between retries.
35+
* @return The delay interval.
36+
*/
37+
String delayInterval();
38+
}

0 commit comments

Comments
 (0)