How brokers forwarding messages to workflow

First of all, I would like to say, that we are trying to evaluate Zeebe for our new product, and we found it’s design, architecture, and ideas great! :wink:

So, talking about my case.

Step 1. I have designed very simple workflow: start event → intermediate message catch event → service task → end event, gave the id “Process01” to it, and deploy it to Zebee.

Step 2. I simply copied bpmn file, rename workflow, set it’s id to “Process02”, and deploy it too.

Step 3. I have create two instances of Process01 and one instance of Process02 workflows, with absolutely identical variables for all of them.

Step 4. Publish a message command with the specific message name (that exists in both workflows), and specific correlation key (that is good for all three instances).

As a result I see that one earliest instance of Process01 is processed, instance of Process02 is processed, and the second instance of Process01 is not processed.

So, my questions are:

  • is it possible to specify workflow id somehow to publish message only for that kind of workflows?
  • is it possible to process all the instances that awaits for that specific message?

Hi @Gorynych regarding your questions… I think that question number #2 is not possible as stated in the docs -> https://docs.zeebe.io/reference/message-correlation/message-correlation.html#message-cardinality

For question #1 you can use a unique correlationId per process instance, by doing that you will be targeting that specific instance.

Hi @salaboy. Thanks a lot - I definitely missed that paragraph ), and it looks like an answer for both of my questions.

But… Can you please give me some idea behind that design decision? Why is not possible to route event to all the subscribers?

Good question. I try to explain the two main points quickly:

  • combination with buffering of messages (i.e. time-to-live > 0). A workflow may have multiple message catch events for the same message (name + correlation-key), for example, aggregate incoming messages. Following the rule “a message correlates to all open subscriptions”, all buffered messages must be correlated to this message catch event even if they are correlated before. In most cases, this is not what you want.
  • the BPMN semantic of message events. According to the specification, a message is sent to a single receiver. If an event should be broadcast then it must be a signal event.
1 Like

Hi Philipp.

Thanks a lot!

1 Like