Start camunda process using spring boot api


I have spring boot rest api to start the process and the process getting started behind the scene but I am getting below error in console as well in response.
Below are the code that I am using to start the process.

ProcessInstanceResult instanceResult = zeebeClient .newCreateInstanceCommand() .bpmnProcessId(processId) .latestVersion() .variables(processVariables) .withResult() .send() .join();

io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: Time out between gateway and broker: Request ProtocolRequest{id=531, subject=command-api-1, sender=, payload=byte[]{length=283, hash=-951148236}} to timed out in PT9.999S
	at io.grpc.Status.asRuntimeException( ~[grpc-api-1.54.1.jar:1.54.1]
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose( ~[grpc-stub-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl.closeObserver( ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl.access$300( ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal( ~[grpc-core-1.54.1.jar:1.54.1]
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext( ~[grpc-core-1.54.1.jar:1.54.1]
	at ~[grpc-core-1.54.1.jar:1.54.1]
	at ~[grpc-core-1.54.1.jar:1.54.1]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker( ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$ ~[na:na]
	at java.base/ ~[na:na]

Can anyone please help on this?


1 Like

@BerndRuecker could you please assist on the above issue?

Do you get the same error for the same process if you leave out the .withResult() ?

You might get this timeout error if you are trying to mix an async process and a sync process (by using the .withResult )

@yadav1990 - please stop necro-posting on very old threads, and instead start a new thread with your question, or continue your existing thread. This is a community forum and not an official support avenue; if you need priority support for issues, I’d be happy to get you in touch with someone to discuss your support needs.

Please try the suggestion above first. Depending on the results, you can try increasing the timeout on the join method (or through other client settings you can find in the Javadocs). (Reference thread - please continue the conversation and troubleshooting here, however.)

Hi @yadav1990 - looks like a connection problem somewhere - but nothing specifically I can point to. Is the platform running fine in general? What’s your setup (SaaS, self-managed? If the latter, Docker Compose, Kubernetes, …). There is more information needed to hint you in the right direction.

@GotnOGuts: Shouldn’t have to do with withResult (but never say never :wink: )

I have self-managed manual setup for broker, elasticsearch and operate and configured the broker gateway address to in springboot app.

I also tried to increase the time in . join(120,TimeUnit.SECONDS) but didn’t work and got the same error.

Do you get the same error without the .withResult() ?

@yadav1990 - are you able to connect to the Operate web UI without error? Have you tried any other methods of starting a process, such as zbctl? Based on what you’ve shared, it seems to me the issue might be with your environment configuration rather than your application.

no we are not getting any error without .withResult().

yes, I am able to connect with operate without any error. And I can’t see any issue with that.

Only issue is when we are using .withResult() and this issue is reproducible.

@yadav1990 - when you start the process without .withResult(), do you see the instance in Operate? I would assume yes? Then, when you start the process with .withResult(), do you see the instance in Operate? (In other words, is it a timeout waiting for the process to complete, or is it a timeout trying to communicate with the gateway?) Based on the information you’ve just provided, it sounds like @GotnOGuts had the right idea: the process is taking longer than the timeout to complete.

In both the cases I can see the process instance in operate but the only difference is .withResult throwing above mentioned error.Even I tried to increase the timeout using .join(2,TimeUnit.MINUTES) and didn’t worked.

@yadav1990 - that means the process isn’t completing within the timeout window. Are you seeing the process complete before the exception is thrown?

This is not exact (nor 100% correct), but this is the concept of what is causing your error.

this can’t be visualized. But yes, process started behind the scenes, and I can only confirm the process started or not by logging into operate.