diff --git a/example/pom.xml b/example/pom.xml index 29ec3d492..48c333093 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -38,7 +38,7 @@ com.byteblogs x-retry-client-starter - 0.0.4.2-SNAPSHOT + 0.0.4.2 com.baomidou diff --git a/example/src/main/java/com/example/controller/StudentController.java b/example/src/main/java/com/example/controller/StudentController.java index 14853c722..7cade2bdc 100644 --- a/example/src/main/java/com/example/controller/StudentController.java +++ b/example/src/main/java/com/example/controller/StudentController.java @@ -1,9 +1,16 @@ package com.example.controller; +import com.example.demo.TestExistsTransactionalRetryService; +import com.x.retry.common.core.annotation.OriginalControllerReturnValue; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RestController; + +import java.util.UUID; /** *

@@ -13,8 +20,16 @@ import org.springframework.stereotype.Controller; * @author www.byteblogs.com * @since 2022-03-24 */ -@Controller +@RestController @RequestMapping("/student") public class StudentController { + @Autowired + private TestExistsTransactionalRetryService testExistsTransactionalRetryService; + + @GetMapping("query") + @OriginalControllerReturnValue + public String get() { + return testExistsTransactionalRetryService.testSimpleInsert(UUID.randomUUID().toString()); + } } diff --git a/example/src/main/java/com/example/controller/TeacherController.java b/example/src/main/java/com/example/controller/TeacherController.java index 8cddf95ad..fd6f304d6 100644 --- a/example/src/main/java/com/example/controller/TeacherController.java +++ b/example/src/main/java/com/example/controller/TeacherController.java @@ -38,7 +38,7 @@ public class TeacherController { } @GetMapping("test-status-code") - @Retryable(scene = "testStatusCode") + @Retryable(scene = "testStatusCode", isThrowException = false) public Result testStatusCode() { Result result = restTemplate.getForObject("http://127.0.0.1:8088/school/id", Result.class); diff --git a/example/src/main/java/com/example/demo/NestMethodService.java b/example/src/main/java/com/example/demo/NestMethodService.java index c80829d9c..6fa3d8372 100644 --- a/example/src/main/java/com/example/demo/NestMethodService.java +++ b/example/src/main/java/com/example/demo/NestMethodService.java @@ -17,7 +17,7 @@ public class NestMethodService { @Autowired private TestExistsTransactionalRetryService testExistsTransactionalRetryService; - @Retryable(scene = "testNestMethod") + @Retryable(scene = "testNestMethod" , isThrowException = false) @Transactional public void testNestMethod() { testExistsTransactionalRetryService.testSimpleInsert(UUID.randomUUID().toString()); diff --git a/example/src/test/java/com/example/ExistsTransactionalRetryServiceTest.java b/example/src/test/java/com/example/ExistsTransactionalRetryServiceTest.java index 6d91466e7..24eba4785 100644 --- a/example/src/test/java/com/example/ExistsTransactionalRetryServiceTest.java +++ b/example/src/test/java/com/example/ExistsTransactionalRetryServiceTest.java @@ -39,7 +39,7 @@ public class ExistsTransactionalRetryServiceTest { Mockito.when(remoteService.call()) .thenReturn(new Result(0, "1")) .thenReturn(new Result(0, "2")) - .thenReturn(new Result(1, "3")) + .thenReturn(new Result(0, "3")) .thenReturn(new Result(0, "4")) .thenReturn(new Result(0, "5")) ; diff --git a/pom.xml b/pom.xml index 513042a2f..4c7426d46 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 1.8 1.8 1.8 - 0.0.4.2-SNAPSHOT + 0.0.4.2 1.0.0 11.7 5.4.2.Final @@ -91,15 +91,36 @@ - rdc-releases - https://repo.rdc.aliyun.com/repository/69606-release-476gHC/ + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ - rdc-snapshots - https://repo.rdc.aliyun.com/repository/69606-snapshot-XnE7nN/ + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + https://github.com/byteblogs168/x-retry + https://github.com/byteblogs168/x-retry.git + https://github.com/byteblogs168 + + + + + byteblogs + byteblogs@aliyun.com + https://github.com/byteblogs168 + + + diff --git a/x-retry-client-core/pom.xml b/x-retry-client-core/pom.xml index 32668d637..9bad498f7 100644 --- a/x-retry-client-core/pom.xml +++ b/x-retry-client-core/pom.xml @@ -76,17 +76,6 @@ - - - rdc-releases - https://repo.rdc.aliyun.com/repository/69606-release-476gHC/ - - - rdc-snapshots - https://repo.rdc.aliyun.com/repository/69606-snapshot-XnE7nN/ - - - diff --git a/x-retry-client-starter/pom.xml b/x-retry-client-starter/pom.xml index e1cdc7845..a59a1d6d8 100644 --- a/x-retry-client-starter/pom.xml +++ b/x-retry-client-starter/pom.xml @@ -34,15 +34,4 @@ - - - rdc-releases - https://repo.rdc.aliyun.com/repository/69606-release-476gHC/ - - - rdc-snapshots - https://repo.rdc.aliyun.com/repository/69606-snapshot-XnE7nN/ - - - diff --git a/x-retry-common/x-retry-common-client-api/pom.xml b/x-retry-common/x-retry-common-client-api/pom.xml index ce4a7d9df..e25220091 100644 --- a/x-retry-common/x-retry-common-client-api/pom.xml +++ b/x-retry-common/x-retry-common-client-api/pom.xml @@ -40,17 +40,6 @@ - - - rdc-releases - https://repo.rdc.aliyun.com/repository/69606-release-476gHC/ - - - rdc-snapshots - https://repo.rdc.aliyun.com/repository/69606-snapshot-XnE7nN/ - - - diff --git a/x-retry-common/x-retry-common-core/pom.xml b/x-retry-common/x-retry-common-core/pom.xml index c370074f9..5cbbb7e03 100644 --- a/x-retry-common/x-retry-common-core/pom.xml +++ b/x-retry-common/x-retry-common-core/pom.xml @@ -54,17 +54,6 @@ - - - rdc-releases - https://repo.rdc.aliyun.com/repository/69606-release-476gHC/ - - - rdc-snapshots - https://repo.rdc.aliyun.com/repository/69606-snapshot-XnE7nN/ - - - diff --git a/x-retry-common/x-retry-common-server-api/pom.xml b/x-retry-common/x-retry-common-server-api/pom.xml index a73cca71c..ae5b10eb9 100644 --- a/x-retry-common/x-retry-common-server-api/pom.xml +++ b/x-retry-common/x-retry-common-server-api/pom.xml @@ -39,17 +39,6 @@ - - - rdc-releases - https://repo.rdc.aliyun.com/repository/69606-release-476gHC/ - - - rdc-snapshots - https://repo.rdc.aliyun.com/repository/69606-snapshot-XnE7nN/ - - -