Zeebe-client-java 8.7.0 error

Hii, everyone I am currently trying zeebe-client-java 8.7.0 alpha2
I have shared my code below but let me explain what happens here.
It first deploys my bpmn file and than i am trying to fetch xml content from zeebe client ,
Yes I might get it from deployment event but in some cases if I already have files deployed and i want xml content than i want to use zeebe client to fetch xml content
Please suggest if there are other ways but here it my code

public class DeployProcess {
    public static void main(String args[]) {
     
        // Deploy the BPMN process
        DeploymentEvent deploymentEvent = MainClass.client.newDeployResourceCommand()
            .addResourceFile("src/main/resources/converted-c8-wayf_new.bpmn")  // Replace with the path to your BPMN file
            .send()
            .join();

        for ( Process process : deploymentEvent.getProcesses()) {
       
            try {
                System.out.println("---------1------------");
                
                byte[] bpmnXmlBytes = MainClass.client.newProcessDefinitionGetXmlRequest(process.getProcessDefinitionKey())
                        .send()
                        .join().getBytes();
                String bpmnXml = new String(bpmnXmlBytes, java.nio.charset.StandardCharsets.UTF_8);

                System.out.println(bpmnXml);
                System.out.println("-----------2----------");
             
            } catch (Exception e) {
              
                e.printStackTrace();
            }
        }
        // Output the deployment details
        System.out.println("Deployment successful.");
        
      
    }
}

It executes up till ------1------ than waits for a minute or two and than will throw error, Here file is deployed successfully, but between -----1----- and ------2------ it will show error like this

this is my zeebe client

 public static ZeebeClient client = ZeebeClient.newClientBuilder()
	        	.gatewayAddress("localhost:26500")
	            .usePlaintext()  
	            .build();
	

If system can’t access localhost:26500 than why deployment is happening and problem is with fetching xml only

Here is my setup overview:
I am using camunda self managed using helm and kubernetes.
I have one instance of zeebe and one for gateway,
Port forwarding is active for gateway service which is 26500:26500

Hi @vishu899 - what version of Camunda are you using? If you aren’t using an 8.7 alpha build, I’d recommend reverting the client to match your Camunda version.

However, I believe the root cause here is the Zeebe gRPC API vs the new unified REST API. The first call is using the gRPC endpoint, but the second call to get the XML is using the REST endpoint. You need to explicitly enable the REST API and I suspect that might be missing in your Camunda install.

This would also explain why the error message talks about errors connecting to 0.0.0.0:8080 rather than 0.0.0.0:26500

1 Like