What is the best way to model a waiting state for a kafka message?


I would like to model flow where after a state we wait for a kafka message to arrive and then move forward to next state.

How do I model it ? I get lot of hits on how to do it using Zeebe, but we dont use Zeebe. There is 5 years old article which I am not sure how relevant it is today

Hello @sherry-ummen ,

the best way is either a Message Receive Task or a Intermediate Message Receive Event. Both have the same behaviour:

They wait for a incoming message that is correlated either from the Rest Api or the Java Api.

Hope this helps


@sherry-ummen you can refer this model to wait for kafka message.

1 Like

Thank you. Btw so we have multiple processes running in parallel.

So our typical model is that we create a ticket … which is basically sending a kafka message, then we wait for the response and then move to another state.

Now if we use ReceveTask or MessageEvent then we need to somehow to keep track of which process is waiting for the response. No? And how do you handle that ? Do you pass that information also with the kafka messages or some other bookkeeping?

Hey @sherry-ummen. Yeah, you will have to correlate the messages with the process instances. Take a look on Correlate a Message | docs.camunda.org.

1 Like