tchiotludo / akhq

Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
https://akhq.io/
Apache License 2.0
3.41k stars 660 forks source link

Adding kafka properties to KafkaProtobufDeserializer. #1934

Open StephanePaulus opened 2 months ago

StephanePaulus commented 2 months ago

Adding kafka properties to KafkaProtobufDeserializer, to be able to execute schema registry rules.

In class: AbstractKafkaSchemaSerDe, method protected Object executeRules, line 671

      RuleContext ctx = new RuleContext(config.originals(), source, target,
          subject, topic, headers,
          isKey ? original : key(),
          isKey ? null : original,
          isKey, ruleMode, rule, i, rules);

config.originals() will throw a null pointer exception and fail the deserialization.

Not sure if my fix is the best way, I guess maybe a method that takes all the kafka properties from both kafka and the schema registry including the URL and username/password with the default key that are defined in the connection configuration?