You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/10/13 09:50:35 UTC

[GitHub] [rocketmq] lizhimins commented on issue #5250: Whether it is necessary to add a hook to handle the failure of rpc processing?

lizhimins commented on issue #5250:
URL: https://github.com/apache/rocketmq/issues/5250#issuecomment-1277346557

   how about:
   
   ```Java
   public interface RPCHook {
       void doBeforeRequest(final String remoteAddr, final RemotingCommand request);
   
       void doAfterResponse(final String remoteAddr, final RemotingCommand request,
                            final RemotingCommand response);
   
       default void doAfterFailure(final String remoteAddr, RemotingCommand request, RemotingContext remotingContext) {
   
       }
   }
   ```
   
   ```Java
   public class RemotingContext {
   
       private Throwable throwable;
   
       private boolean remoteTimeout;
   
       public Throwable getThrowable() {
           return throwable;
       }
   
       public void setThrowable(Throwable throwable) {
           this.throwable = throwable;
       }
   
       public boolean isRemoteTimeout() {
           return remoteTimeout;
       }
   
       public void setRemoteTimeout(boolean remoteTimeout) {
           this.remoteTimeout = remoteTimeout;
       }
   }
   ```


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org