Spring Boot Java client cannot connect to Zeebe Docker

  1. sudo docker runzeebe -0 26500-26502:26500-26502 camunda/zeebe:latest

2.[liyc@localhost bin]$ sudo docker inspect --format ‘{{ .NetworkSettings.IPAddress }}’ zeebe
172.17.0.2


4.

public static void main(final String args) {
//111.194.11.28:26500
//172.17.0.2:26500
final String defaultAddress = “172.17.0.2:26500”;
final String envVarAddress = System.getenv(“ZEEBE_ADDRESS”);

final ZeebeClientBuilder clientBuilder;
if (envVarAddress != null) {
  /* Connect to Camunda Cloud Cluster, assumes that credentials are set in environment variables.
   * See JavaDoc on class level for details
   */
  clientBuilder = ZeebeClient.newClientBuilder().gatewayAddress(envVarAddress);
} else {
  // connect to local deployment; assumes that authentication is disabled
  clientBuilder = ZeebeClient.newClientBuilder().gatewayAddress(defaultAddress).usePlaintext();
}

=================
Exception in thread “main” io.camunda.zeebe.client.api.command.ClientStatusException: deadline exceeded after 8.545818000s. [closed=, open=[[buffered_nanos=8555783800, waiting_for_connection]]]
at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.transformExecutionException(ZeebeClientFutureImpl.java:116)
at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:54)
at io.camunda.zeebe.example.process.ProcessDeployer.main(ProcessDeployer.java:59)
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 8.545818000s. [closed=, open=[[buffered_nanos=8555783800, waiting_for_connection]]]
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at io.camunda.zeebe.client.impl.ZeebeClientFutureImpl.join(ZeebeClientFutureImpl.java:52)
… 1 more
Caused by: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 8.545818000s. [closed=, open=[[buffered_nanos=8555783800, waiting_for_connection]]]
at io.grpc.Status.asRuntimeException(Status.java:537)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481)
at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489)
at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:453)
at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:486)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:567)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:71)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:735)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:716)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)