vert-x3 / vertx-kafka-client

Reactive Kafka Client for Vert.x
Apache License 2.0
84 stars 82 forks source link

io.vertx.kafka.client.consumer.OffsetAndMetadata equals and hashcode contract #274

Open arkadiuszpalka opened 1 month ago

arkadiuszpalka commented 1 month ago

Version

4.5.9

Context

The io.vertx.kafka.client.consumer.OffsetAndMetadata doesn't respect the equals and hashcode contract. I encountered it while I was writing unit tests and IMO it looks like a bug because io.vertx.kafka.client.common.TopicPartition respects that contract.

Do you have a reproducer?

No, please evaluate these expressions:

// Kotlin
OffsetAndMetadata(1, null) == OffsetAndMetadata(1, null) // false
TopicPartition("MOCK_TOPIC", 1) == TopicPartition("MOCK_TOPIC", 1) // true

Steps to reproduce

Not needed

Extra

java -version

openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment Homebrew (build 17.0.10+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.10+0, mixed mode, sharing)