Skip to content

Commit

Permalink
feat(retry): disable retry for blocking exceptions (#370)
Browse files Browse the repository at this point in the history
* feat(retry): disable retry for blocking exceptions

* fix: tests

* Update src/test/java/it/pagopa/transactions/services/v1/CircuitBreakerTest.java

Co-authored-by: Giovanni Berti <[email protected]>

* fix: renaming local variable

* fix: code review

* Update src/test/java/it/pagopa/transactions/services/v2/CircuitBreakerTest.java

Co-authored-by: Giovanni Berti <[email protected]>

---------

Co-authored-by: Giovanni Berti <[email protected]>
  • Loading branch information
pietro-tota and giovanniberti authored Dec 1, 2023
1 parent e466e20 commit c430cb5
Show file tree
Hide file tree
Showing 4 changed files with 579 additions and 28 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@
<version>${mock-web-server.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
Expand Down
98 changes: 93 additions & 5 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,89 @@
resilience4j.retry:
instances:
getPaymentRequestInfo:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
newTransaction:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
getTransactionInfo:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
requestTransactionAuthorization:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
updateTransactionAuthorization:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
activateTransaction:
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
cancelTransaction:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
addUserReceipt:
maxAttempts: 3
waitDuration: 2s
enableExponentialBackoff: false
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException

resilience4j.circuitbreaker:
configs:
Expand All @@ -37,10 +97,38 @@ resilience4j.circuitbreaker:
instances:
transactions-backend:
baseConfig: default
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
node-backend:
baseConfig: default
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException
ecommerce-db:
baseConfig: default
ignoreExceptions:
- it.pagopa.transactions.exceptions.UnsatisfiablePspRequestException
- it.pagopa.transactions.exceptions.PaymentNoticeAllCCPMismatchException
- it.pagopa.transactions.exceptions.TransactionNotFoundException
- it.pagopa.transactions.exceptions.AlreadyProcessedException
- it.pagopa.transactions.exceptions.NotImplementedException
- it.pagopa.transactions.exceptions.InvalidRequestException
- it.pagopa.transactions.exceptions.TransactionAmountMismatchException
- it.pagopa.transactions.exceptions.NodoErrorException
- it.pagopa.transactions.exceptions.InvalidNodoResponseException

Loading

0 comments on commit c430cb5

Please sign in to comment.