dugenkui03 commented on issue #3973: URL: https://github.com/apache/rocketmq/issues/3973#issuecomment-1092077125
@aaron-ai Some optimized suggestion about api-module, please take a look. 1. Create masker interface `ErrorClassification`, and replace `ErrorCode` with `ErrorClassification` in `ClientException`. I think developer need custom error type, such as limitation; 2. Replace `CompletableFuture` with `Future` in `Producer#sendAsync`, since `Future` is more extensibie. the default implementation of `Producer#sendAsync` still can use `CompletableFuture`; 3. Replace `BackoffRetryPolicy` with `RetryPolicy` in `ProducerBuilder#setRetryPolicy `. #### Describe in Chinese 您好,关于 api-module 有些建议请评估是否采纳: 1. 创建标记接口`ErrorClassification`、并使`ErrorCode`实现该接口,`ClientException`中`ErrorCode`替换为`ErrorClassification`。因为我认为开发者经常需要自定义异常和异常类型,例如限流,而现在的接口设计其实也支持用户自定义异常; 2. 在`Producer#sendAsync`中使用`Future`替换`CompletableFuture`,因为前者已经可以满足接口需要,我们可以再具体实现中在返回`CompletableFuture`; 3. 在`ProducerBuilder#setRetryPolicy`中使用`RetryPolicy`替换 `BackoffRetryPolicy`。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
