Skip to content

Instantly share code, notes, and snippets.

@berndruecker
Created April 7, 2021 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berndruecker/c379e8ea4e2ddaa134764d94c4a560b6 to your computer and use it in GitHub Desktop.
Save berndruecker/c379e8ea4e2ddaa134764d94c4a560b6 to your computer and use it in GitHub Desktop.
zeebeClient
.newWorker()
.jobType(jobType)
.handler(new ExampleJobHandler())
.timeout(Duration.ofSeconds(10))
.open()) {
waitUntilSystemInput("exit");
}
// ...
class ExampleJobHandler implements JobHandler {
public void handle(final JobClient client, final ActivatedJob job) {
// here: business logic that is executed with every job
System.out.println(job);
client.newCompleteCommand(job.getKey()).send().join();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment