gRPCサービスで2つのServerInterceptorをバインドします。最初のServerInterceptroでServerCallが終了したときに、残りのgRPC(java)ServerInterceptorを無視する方法はありますか?
最初のインターセプタでは、ServerCallは閉じられていますが、2番目のインターセプタはまだ関与しています。
ServerCallが最初のインターセプタで閉じられている間、残りのインターセプタをスキップする方法はありますか?
最初のインターセプター:
public class FirstInterceptor implements ServerInterceptor {
@Override
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(
ServerCall<ReqT, RespT> call,
Metadata headers,
ServerCallHandler<ReqT, RespT> next) {
if(...){
...
return Contexts.interceptCall(context, call, headers, next);
}else{
...
call.close(Status.UNAUTHENTICATED.withDescription("@FST_INTCP"),GrpcUtil.getMetadataWithErrMsg(e));
return next.startCall(new ForwardingServerCall.SimpleForwardingServerCall<ReqT, RespT>(call) {}, headers);
}
}
}