Pyla Srenu: Hello Community,
I am new to zeebe, created one sample workflow and able to deploy that into operate. Able to execute service task using java zeebe client. Started 4 instances.
all the 4 instances are executing at the same time If I use zeebeworker (type).
But my question here, i want to execute only one instance using zeebeworker with some specific parameters . is that possible ?
korthout: Hi @Pyla Srenu You can configure your job worker to ask for only 1 job at a time by setting the maxJobsToActivate
See https://github.com/camunda-cloud/zeebe/blob/main/clients/java/src/main/java/io/camunda/zeebe/client/api/worker/JobWorkerBuilderStep1.java#L104-L128
Note that even if multiple jobs are activated at the same time, they are handled sequentially by default. This is because the numJobWorkerExecutionThreads
is set to 1 by default. See https://github.com/camunda-cloud/zeebe/blob/main/clients/java/src/main/java/io/camunda/zeebe/client/ZeebeClientBuilder.java#L47-L51
I’d like to add a counter question, why do you only want to have 1 job executed at a time? One of Camunda Cloud’s advantages is its high throughput, which can be achieved by having many process instances and jobs being worked on simultaneously.
Pyla Srenu: Hi @korthout - Thanks for the reply with description.
I am looking for, Will expose my own rest APIs to the UI to complete some user related stuff and along with this complete tasks in my logic itself using zeebeclient without using zeebeworker.
in this case I am getting complex here to get where is the process by inctanceProcessKey.
So I can easily complete that task using processinstancekey or any random uuid (I sent this UUID to the start the process instance to identify the process).
I am able to achieve my use case using camunda. but zeebe i am confusing how to do this.
Note: This post was generated by Slack Archivist from a conversation in the Zeebe Slack, a source of valuable discussions on Zeebe (get an invite). Someone in the Slack thought this was worth sharing!
If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs.