Message Correlation significance and usage

What does createMessageCorrelation("my-message") mean below and what is it significance?

execution.
			getProcessEngine().
			getRuntimeService().
			createMessageCorrelation("my-message")
			 .processInstanceBusinessKey("poc-workflow")
			 .setVariable("payment_type", "creditCard")
			  .correlate();

That is a code-driven “Send Message” event, showing which specific process the message is being sent to (remember message is supposed to be a one-to-one), along with the contents of the message (variables)

Which message is being sent: “my-message”
Which process is destination: “poc-workflow”
What contents of message: “payment_type=creditCard”

See also: Message Events | docs.camunda.org

1 Like

Thanks its a bit clear now.
remember message is supposed to be a one-to-one . By this you mean i can read my-message only once ?In order 2 read the my-message in Start the event as shown in daigram.
Is this correct?I have attached the BPMN .xml too
correlation.bpmn (8.3 KB)

One process instance throws the message.
Exactly one process instance catches the message.

If you need the message to be caught again, it needs to be thrown again.
If you needs more than one process instance to catch the message, then message isn’t the component you are looking for.

The image of the model you shared shows a “one-to-one” configuration.