Hi, We are trying demonstrate usecase using the camunda with Kafka messages. We have different applications generates events. We want to do a POC to demonstrate this workflow using Camunda.AS soon as there is an event on topic1, the camunda BPMN process will kick off and look for the event and take the acount_id and set it to the process Environment variable and continue to the next task(receiving message task), the second taks will listen to the second event Event1a for the account id that is set in the first task, if it matches then continue to the next task in the process flow. Could anyone please help with this model with sample steps. currently I have the application running, but the problem is it is invoking one process and it listens for the message. I would like to spawn the process workflow for each event that comes from kafka topic.
Here is a example for using RabbitMQ
In this case I was sending JSON based messages, so the same data structure as the /message REST API endpoint is used.
You would just need to swap out Rabbit for a Kafka message structure
Hi Stephen, Thank you very much for your quick response. May be I didnt explain my issue properly. I am mainly looking at how to model my usecase in camunda and what are the main configuration that i need to use for my usecase. My use case is, whenever there is an account created, there will be a event produced on the kafka topic. My BPMN process kicks form here, My BPMN process look for this event, and as soon as the event occurered, I take the account no and set it to process variable and proceed to the next receive event. The next task is also a receive task, it waits for the payment event for the corresponding account no, if it gets the event then proceed to the next event. Here for each event that coming into Kafka topic i need to spawn a separate BPMN process instance flow. Here is the BPMN model.
could you please help us.
The setup I linked to follows this model. But do not think of it as your BPMN is looking at the queue: think of it as there is a consumer that is attempting to “correlate” messages into the Camunda Engine. The BPMN is waiting for a successful correlation based on the message configuration.
So your BPMN model would have Message Catch Events (or Messge Start Events) and/or Receive Activities, with Message Names configured. You Then use your consumer of the queue to run a Correlation command against the engine.
If you look at the code i linked previously, this exact model is done with a Rabbit queue, where the Message Correlation is occurring using the classes that are used for the Camunda Rest API for the `/message/ endpoint. But you can roll your own using the MessageCorrelationBuilder as linked above.