Exeption with java client


#1

I started broker docker run --name zeebe -p 51015:51015 camunda/zeebe:0.10.0

  • configFile=/usr/local/zeebe/conf/zeebe.cfg.toml
  • INITIAL_CONTACT_POINT=
    ++ hostname -i
  • ZEEBE_HOST=172.17.0.2
  • BOOTSTAP=1
  • [[ false == \t\r\u\e ]]
  • sed -i ‘s/bootstrap =.*/bootstrap = 1/g’ /usr/local/zeebe/conf/zeebe.cfg.toml
  • sed -i ‘s/.host =./host = “172.17.0.2”/g’ /usr/local/zeebe/conf/zeebe.cfg.toml
  • ‘[’ -n ‘’ ‘]’
  • exec /usr/local/zeebe/bin/broker
    10:31:40.585 [] [main] INFO io.zeebe.broker.system - Using configuration file /usr/local/zeebe/conf/zeebe.cfg.toml
    10:31:40.746 [] [main] INFO io.zeebe.broker.system - Scheduler configuration: Threads{cpu-bound: 2, io-bound: 2}.
    10:31:40.827 [] [main] INFO io.zeebe.broker.system - Version: 0.10.0
    10:31:40.907 [] [main] INFO io.zeebe.broker.clustering - Starting standalone broker.
    10:31:40.923 [service-controller] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.transport - Bound managementApi.server to /172.17.0.2:51016
    10:31:40.965 [service-controller] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.transport - Bound clientApi.server to /172.17.0.2:51015
    10:31:40.966 [service-controller] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.transport - Bound replicationApi.server to /172.17.0.2:51017
    10:31:40.995 [io.zeebe.broker.clustering.base.bootstrap.BootstrapSystemTopic] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.clustering - Boostrapping internal system topic ‘internal-system’ with replication factor 1.
    10:31:41.361 [service-controller] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.raft - Created raft internal-system-0 with configuration RaftConfiguration{heartbeatInterval=‘250ms’, electionInterval=‘1s’, leaveTimeout=‘1s’}
    10:31:41.366 [io.zeebe.broker.clustering.base.bootstrap.BootstrapSystemTopic] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.broker.clustering - Bootstrapping default topics [TopicCfg{name=‘default-topic’, partitions=1, replicationFactor=1}]
    10:31:41.424 [internal-system-0] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.raft - Joined raft in term 0
    10:31:41.535 [topics] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.clustering - Updating topic {“topicName”:“internal-system”,“partitionCount”:1,“replicationFactor”:1,“key”:4294967400,“partitionIds”:[0]}
    10:31:41.537 [topics] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.clustering - Creating topic {“name”:“default-topic”,“partitions”:1,“replicationFactor”:1,“partitionIds”:[]}
    10:31:41.540 [topics] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.clustering - Adding topic {“topicName”:“default-topic”,“partitionCount”:1,“replicationFactor”:1,“key”:4294967576,“partitionIds”:[]}
    10:31:42.578 [management-api] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.clustering - Received create partition request for topic=default-topic, partitionId=1 and replicationFactor=1
    10:31:42.582 [service-controller] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.raft - Created raft default-topic-1 with configuration RaftConfiguration{heartbeatInterval=‘250ms’, electionInterval=‘1s’, leaveTimeout=‘1s’}
    10:31:42.586 [default-topic-1] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.raft - Joined raft in term 0
    10:31:42.590 [create-topic] [172.17.0.2:51015-zb-actors-1] INFO io.zeebe.broker.clustering - Partition 1 for topic default-topic created on node 172.17.0.2:51016
    10:31:42.593 [topics] [172.17.0.2:51015-zb-actors-0] INFO io.zeebe.broker.clustering - Updating topic {“topicName”:“default-topic”,“partitionCount”:1,“replicationFactor”:1,“key”:4294967576,“partitionIds”:[1]}

When I`m trying run my JavaClient
version broker and client are the same

public static void main(String[] args)
{
final Properties clientProperties = new Properties();
// change the contact point if needed
clientProperties.put(ClientProperties.BROKER_CONTACTPOINT, “localhost:51015”);

  final ZeebeClient client = ZeebeClient.newClientBuilder()
      .withProperties(clientProperties)
      .build();
  System.out.println("Connected.");
  final DeploymentEvent deployment = client.topicClient().workflowClient()
      .newDeployCommand()
      .addResourceFromClasspath("test.bpmn")
      .send()
      .join();
  final int version = deployment.getDeployedWorkflows().get(0).getVersion();
  System.out.println("Workflow deployed. Version: " + version);
  client.close();
  System.out.println("Closed.");
}

I have Exception

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class “org.slf4j.impl.StaticMDCBinder”.
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
Connected.
Exception in thread “main” io.zeebe.client.cmd.ClientException: Request timed out (PT15S). Request was: [ topic = internal-system, partition = 0, value type = DEPLOYMENT, command = CREATE ]
at io.zeebe.client.cmd.ClientException.newInCurrentContext(ClientException.java:45)
at io.zeebe.client.impl.RequestManager$ResponseFuture.join(RequestManager.java:482)
at deployment.Application.main(Application.java:27)
Caused by: io.zeebe.client.cmd.ClientException: Request timed out (PT15S). Request was: [ topic = internal-system, partition = 0, value type = DEPLOYMENT, command = CREATE ]
at io.zeebe.client.impl.RequestManager$ResponseFuture.failWith(RequestManager.java:419)
at io.zeebe.client.impl.RequestManager$ResponseFuture.ensureResponseAvailable(RequestManager.java:333)
at io.zeebe.client.impl.RequestManager$ResponseFuture.get(RequestManager.java:438)
at io.zeebe.client.impl.RequestManager$ResponseFuture.get(RequestManager.java:427)
at io.zeebe.client.impl.RequestManager$ResponseFuture.join(RequestManager.java:473)
… 1 more
Caused by: java.util.concurrent.ExecutionException: Request timed out after PT15S
at io.zeebe.util.sched.future.CompletableActorFuture.get(CompletableActorFuture.java:181)
at io.zeebe.client.impl.RequestManager$ResponseFuture.ensureResponseAvailable(RequestManager.java:308)
… 4 more
Caused by: io.zeebe.transport.RequestTimeoutException: Request timed out after PT15S
at io.zeebe.transport.impl.sender.OutgoingRequest.timeout(OutgoingRequest.java:177)
at io.zeebe.transport.impl.sender.Sender.onTimerExpiry(Sender.java:552)
at org.agrona.DeadlineTimerWheel.poll(DeadlineTimerWheel.java:266)
at io.zeebe.transport.impl.sender.Sender.processTimeouts(Sender.java:105)
at io.zeebe.util.sched.ActorJob.invoke(ActorJob.java:116)
at io.zeebe.util.sched.ActorJob.execute(ActorJob.java:60)
at io.zeebe.util.sched.ActorTask.execute(ActorTask.java:193)
at io.zeebe.util.sched.ActorThread.executeCurrentTask(ActorThread.java:173)
at io.zeebe.util.sched.ActorThread.doWork(ActorThread.java:148)
at io.zeebe.util.sched.ActorThread.run(ActorThread.java:119)

What I’m doing wrong?


#2

Hi,

what operating system do you use? If it is not Linux there is probably a VM involved in your docker setup, which would prevent the client to contact the broker under the IP 172.17.0.2 of the container. You could start the docker container with the environment variable ZEEBE_HOST=0.0.0.0 which will change the IP advertised from the broker to the client to 0.0.0.0 which should be reachable even with a VM in between. Does this help you?

Cheers,
Sebastian