Closed wangchengming666 closed 1 week ago
The updates introduce handling and configuration for user-defined exceptions within the SOFARPC framework. This allows for custom exceptions to be specified for retry logic, enhancing flexibility for business applications to manage retries based on specific needs.
File Path | Change Summary |
---|---|
.../client/FailoverCluster.java |
Added handling for user-defined exceptions in retry logic. |
.../common/RpcOptions.java .../config/ConsumerConfig.java |
Introduced handling and configuration for a new field customerExceptions . |
.../common/rpc-config-default.json |
Added new configuration for user-defined exception collection. |
.../core/exception/RpcErrorType.java |
Added a new constant to represent user-defined exceptions. |
🐇✨ A hop, a skip, in the code we weave, Now custom troubles, you can relieve. Retry, retry, with exceptions you choose, SOFARPC adapts, you no longer lose. 🌟🐰
core/exception/src/main/java/com/alipay/sofa/rpc/core/exception/RpcErrorType.java (1)
`109-109`: The addition of `CUSTOMER_DESIGN_ERROR` with value 310 is correctly implemented and follows the existing naming and coding conventions.core-impl/client/src/main/java/com/alipay/sofa/rpc/client/FailoverCluster.java (1)
`100-106`: The implementation for retrying on user-defined exceptions is correctly placed and follows logical exception handling practices.core/common/src/main/resources/com/alipay/sofa/rpc/common/rpc-config-default.json (1)
`174-175`: The addition of the `consumer.exceptions` configuration key is correctly implemented and allows for specifying user-defined exceptions as expected.core/api/src/main/java/com/alipay/sofa/rpc/common/RpcOptions.java (1)
`305-305`: The addition of the `CONSUMER_EXCEPTIONS` constant is correctly implemented and follows the existing conventions for configuration keys.core/api/src/main/java/com/alipay/sofa/rpc/config/ConsumerConfig.java (1)
`40-40`: The addition of the static import for `getListValue` is appropriate for handling list configurations.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Motivation:
Explain the context, and why you're making that change. To make others understand what is the problem you're trying to solve.
Modification:
Describe the idea and modifications you've done.
Result:
Fixes #.
If there is no issue then describe the changes introduced by this PR.
Summary by CodeRabbit