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