retry机制抛出异常
This commit is contained in:
@@ -18,7 +18,7 @@ public interface DiFyFeign {
|
|||||||
, produces = MediaType.APPLICATION_JSON_VALUE)
|
, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
JSONObject runWorkflows(@RequestHeader(value = "Authorization") String authorization, @RequestBody Map<String, Object> map);
|
JSONObject runWorkflows(@RequestHeader(value = "Authorization") String authorization, @RequestBody Map<String, Object> map);
|
||||||
|
|
||||||
@Retryable(maxAttempts = 1, backoff = @Backoff(delay = 1000))
|
@Retryable(include = Exception.class,maxAttempts = 2, backoff = @Backoff(delay = 1000))
|
||||||
@PostMapping(value = "v1/workflows/run"
|
@PostMapping(value = "v1/workflows/run"
|
||||||
, consumes = MediaType.APPLICATION_JSON_VALUE
|
, consumes = MediaType.APPLICATION_JSON_VALUE
|
||||||
, produces = MediaType.APPLICATION_JSON_VALUE)
|
, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class DiFyRetryImpl {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DiFyService diFyService;
|
private DiFyService diFyService;
|
||||||
@Retryable(maxAttempts = 1, backoff = @Backoff(delay = 1000))
|
@Retryable(include = Exception.class,maxAttempts = 2, backoff = @Backoff(delay = 1000))
|
||||||
public JSONObject getDiFyRetry(DiFyReq diFyReq) {
|
public JSONObject getDiFyRetry(DiFyReq diFyReq) {
|
||||||
log.info("diFyService class: {}", diFyService.getClass());
|
log.info("diFyService class: {}", diFyService.getClass());
|
||||||
return (JSONObject) diFyService.getDiFyObjectRetry(diFyReq);
|
return (JSONObject) diFyService.getDiFyObjectRetry(diFyReq);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class DiFyServiceImpl implements DiFyService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Retryable(maxAttempts = 1, backoff = @Backoff(delay = 1000))
|
@Retryable(include = Exception.class,maxAttempts = 2, backoff = @Backoff(delay = 1000))
|
||||||
public Object getDiFyObjectRetry(DiFyReq diFyReq) {
|
public Object getDiFyObjectRetry(DiFyReq diFyReq) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("inputs",diFyReq.getInputs());
|
map.put("inputs",diFyReq.getInputs());
|
||||||
|
|||||||
Reference in New Issue
Block a user