Skip to main content
Question

Avro Message Key for kafka producer

  • February 22, 2022
  • 3 replies
  • 134 views

Hi,  for Kafka producer, I’m trying to pass both key and value as "avro". while selecting that option, kafka message key shows as "

${avro:decode(record:attribute('avroKeySchema'),base64:decodeBytes(record:attribute('<messsage key attribute name')))}

documentation says, don't change the first part and second part should be message key attribute.. trying to figure out what would the value for these 2 attributes, as I have tried many options and pipeline is failing and unable to write to kafka.

error I receive is, 

CTRCMN_0100 - Error evaluating expression ${avro:decode(record:attribute('RetailPartnerCase'),base64:decodeBytes(record:attribute('accountmanagement_retailpartner_eps_case_domain_event_v1-key')))}: java.lang.NullPointerException

 

so, trying to understand, what I can pass into those 2 attributes? 

3 replies

Drew Kreiger
Rock star
Forum|alt.badge.img
  • Senior Community Builder at StreamSets
  • 95 replies
  • February 24, 2022

  • Author
  • Fan
  • 1 reply
  • March 7, 2022

@dima @Rishi  any updates/thoughts on this? 


Rishi
StreamSets Employee
Forum|alt.badge.img
  • StreamSets Employee
  • 96 replies
  • March 8, 2022

@sgarg is avro key & value both are embedded as SDC Record's Attributes ? or you have schema registry (i.e Confluent schema registry ) ? Can you preview and check the value of SDC record before Kafka producer


Reply