This project allows to leverage Zeebe within your Spring or Spring Boot environment easily. It is basically a wrapper around the Zeebe Java Client.
Just add the @EnableZeebeClient
annotation to your Spring Boot Application:
@SpringBootApplication
@EnableZeebeClient
@ZeebeDeployment(classPathResource = "demoProcess.bpmn")
public class MySpringBootApplication {
Use the @ZeebeDeployment
annotation:
@SpringBootApplication
@EnableZeebeClient
@ZeebeDeployment(classPathResource = "demoProcess.bpmn")
public class MySpringBootApplication {
@ZeebeWorker(type = "foo")
public void handleJobFoo(final JobClient client, final ActivatedJob job) {
// do whatever you need to do
client.newCompleteCommand(job.getKey())
.variables("{\"fooResult\": 1}")
.send().join();
}
zeebe.worker.name="foo-worker"
zeebe.client.broker.contactPoint=127.0.0.1:26500
zeebe.client.security.plaintext=true
For a full set of configuration options please see ZeebeClientConfigurationProperties.java
Connections to the Camunda Cloud are supported out-of-the-box using environment variables. Have a look into the Environment section in the Zeebe Authorization documentation.
Just add the following Maven dependency to your Spring Boot Starter project:
<dependency>
<groupId>io.zeebe.spring</groupId>
<artifactId>spring-zeebe-starter</artifactId>
<version>${CURRENT_VERSION}</version>
</dependency>
Have a look into the examples/ folder for working Maven projects that might serve as inspiration.
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to code-of-conduct@zeebe.io.