Message Correlation example for Camunda 8 has reference of Camunda 7 code

@JobWorker(type="notifyOrder")
public void notifyOrder(@Variable String orderId, @Variable String paymentInformation) {
  Map<String, Object> variables = new HashMap<String, Object>();
  variables.put("paymentInformation", paymentInformation);

  execution.getProcessEngineServices().getRuntimeService()
    .createMessageCorrelation("MsgPaymentReceived")
    .processInstanceVariableEquals("orderId", orderId)
    .setVariables(variables)
    .correlate();
}

The above example should be like below:

zeebeClient.newPublishMessageCommand()
            .messageName("messageNameX")
            .correlationKey("someKeyX")
            .send()
            .join();

Thanks for pointing this out @aravindhrs ! I’ve shared this with the documentation team!