Forum Discussion

RLRE's avatar
RLRE
Occasional Contributor
9 months ago

How can I specify the AVRO key for Kafka messages in ReadyAPI?

Hello!
I am trying to send a Kafka message via ReadyAPI.
The message arrives, however, Kafka reports an error about missing key.
More exactly:

 

Error serializing Avro message
Incompatible schema {<the scheme of key>} with refs [] of type AVRO for schema "string"

 

If I look with 'UI for Apache Kafka' at messages accepted by the system (same topic etc.)
I see that messages always have three 'attributes':

  • Value: This is the message itself (JSON)
  • Headers: This is afortunatelly just an empty JSON object {}. So, we don't need headers.
  • Key: This is a specific value (a JSON containing a single value) for each message, easely computed using a part of the message itself.

In ReadyAPI you specify the 'Value' of the message via 'Data'.
The question is: How can I specify the AVRO key for Kafka messages in ReadyAPI?
The specification of the key as meta data (i.e. Send Data / Metadata / Name = Key or key, Type Kafka) does not work.
Thank you very much for your time.
Regards,
Roberto

No RepliesBe the first to reply