How to add custom ClientInterceptor

how to add custom ClientInterceptor when i use zeebe-client-java,when i add custom ClientInterceptor,throw exception
Caused by: io.zeebe.client.api.command.ClientStatusException: deadline exceeded after 9.846996700s. [buffered_nanos=9866858000, waiting_for_connection]

  clientBuilder.withInterceptors(new CustomInterceptor());
    import io.grpc.CallOptions;
    import io.grpc.Channel;
    import io.grpc.ClientCall;
    import io.grpc.ClientInterceptor;
    import io.grpc.MethodDescriptor;
    public class CustomInterceptor implements ClientInterceptor{

    	@Override
    	public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(MethodDescriptor<ReqT, RespT> method, CallOptions callOptions,
    			Channel next) {
    		// TODO Auto-generated method stub
    		return next.newCall(method, callOptions);
    	}

    }

Hey @coderzjh

thanks for raising this question. Could you make sure, before we continue here, that you can access and send commands to the Broker, without an interceptor? Then the next question would be from my side, what client and broker version you’re using?

Greets
Chris

if without interceptor i can send commands to the broker,i use io.zeebe.client.ZeebeClient,version 0.26.3

Hey @coderzjh

thanks for your response.

We use for example the MonitoringClientInterceptor.java in our benchmarks and this works without issues. Maybe this helps as an example.

Greets
Chris

thanks,Issue has been resolved

1 Like