CorrelationKey string only?

Hey :slight_smile:
based on the docs a correlationKey can either be a String or a Number. But the Java client API supports only Strings as correlationKeys:

  interface PublishMessageCommandStep2 {
    PublishMessageCommandStep3 correlationKey(String correlationKey);
  }

Is it still possible to combine this with Number based job variables or should I convert the corresponding variable to a String to make sure the correlation works as I need to convert the correlationKey:

zeebeClient.newPublishMessageCommand()
  .messageName("myMessage")
  .correlationKey(myNumber.toString()) // conversion needed right now
  .send().join()

Hi @floricdev,

That should be possible.
The gRPC interface requires a String. Therefore, the client supports only Strings.
So if you convert the number to String and use a number variable in Zeebe, the correlation should work. (Havenโ€™t tried it)

And if in doubt, try it out!

2 Likes

ok :slight_smile: Iโ€™ll give it a try.

1 Like