Skip to main content
Version: Next

Java client


To use the Java client library, declare the following Maven dependency in your project:


If you are using Gradle, declare the following:

implementation 'io.camunda:zeebe-client-java:${zeebe.version}'

Use the latest released version from Maven Central.

Spring integration

If you build a Spring or Spring Boot application, you might want to use Spring Zeebe instead of handling the lifecycle and configuration of the Java client yourself (as described in the following paragraphs).


In Java code, instantiate the client as follows:

  private static final String zeebeAddress = "[Zeebe Address]";
private static final String clientId = "[Client ID]";
private static final String clientSecret = "[Client Secret]";
private static final String oAuthAPI = "[OAuth API] ";

public static void main(String[] args) {
OAuthCredentialsProvider credentialsProvider =
new OAuthCredentialsProviderBuilder()

try (ZeebeClient client = ZeebeClient.newClientBuilder()
.build()) {

Let's go over this code snippet line by line:

  1. Declare a few variables to define the connection properties. These values can be taken from the connection information on the Client Credentials page. Note that clientSecret is only visible when you create the client credentials.
  2. Create the credentials provider for the OAuth protocol. This is needed to authenticate your client.
  3. Create the client by passing in the address of the cluster we want to connect to and the credentials provider from the step above. Note that a client should be closed after usage, which is easily achieved by the try-with-resources statement.
  4. Send a test request to verify the connection was established.

See io.camunda.zeebe.client.ZeebeClientBuilder for a description of all available configuration properties.

Another (more compact) option is to pass in the connection settings via environment variables:

export ZEEBE_ADDRESS='[Zeebe Address]'
export ZEEBE_CLIENT_ID='[Client ID]'
export ZEEBE_CLIENT_SECRET='[Client Secret]'

When you create client credentials in Camunda Platform 8, you have the option to download a file with the lines above filled out for you.

Given these environment variables, you can instantiate the client as follows:

ZeebeClient client =


The official Java client library API documentation can be found here. These are standard Javadocs, so your favorite JVM IDE will be able to install them locally as well.

Next steps

  • Getting Started Guide: A comprehensive tutorial that covers Camunda Modeler, Operate, and the Java client.
  • Job worker: An introduction to the Java client's job worker.
  • Logging: An introduction to configuring logging for a Zeebe client.
  • Writing tests: An introduction to unit testing processes.
  • Examples: A collection of specific examples for different use cases.