Home > Software design >  MessageAndMetadata cannot be resolved to a type
MessageAndMetadata cannot be resolved to a type

Time:07-27

The current import that I used for MessageAndMetadata cannot be resolved this is the import that I have used import kafka.message.MessageAndMetadata; which cannot be resolved to a type. I want to implement this in kafka 2.8

CodePudding user response:

I believe it was deprecated in version 2.0 (it doesn't appear in version 2.0 https://github.com/apache/kafka/blob/2.0/core/src/main/scala/kafka/message/MessageAndMetadata.scala, but it is still present in the previous 1.1 version https://github.com/apache/kafka/blob/1.1/core/src/main/scala/kafka/message/MessageAndMetadata.scala)

Given that you want a version compatible with broker 2.8 and that Kafka guarantees that newer library versions can connect to old broker version, but not the other way around, I don't think you will be able to find a version that has the MessageAndMetadata class and that is compatible with 2.8.

  • Related