我想在调用 api 函数中使用 Resilience4J 的重试逻辑,但出现以下错误,如何解决此问题?
val reversalRequestResult = Decorators.ofSupplier {
() => {
determinationService.getTax(getTaxRequest, runID) match {
case Success(getTaxResponse) =>
if (vertexComplianceExceptionHandler.containsGrpcResponseExceptions(getTaxResponse)) {
LOGGER.error("Response has a failure/unsuccessful status for a invoice request")
Some(vertexComplianceExceptionHandler.handleGrpcResponseExceptions(getTaxResponse))
//got error: type mismatch required: Supplier[T_], found: Some[(String, String)]
} else {
// Inserting records into tables
eventInfoCase.record_status = VertexComplianceConstant.RECORD_STATUS_SUCCESS
None
//got error: type mismatch required: Supplier[T_], found: None type
}
case Failure(exception) =>
Some(vertexComplianceExceptionHandler.handleHardGrpcExceptions(exception))
//got error: type mismatch required: Supplier[T_], found: Some[(String, String)]
}
}
}.withRetry(vertexGetTaxResilience.getDefaultRetryInstance())
//error: required: Supplier[T_], found: Function0[Optio(String, String)]
.get()
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)