In what version(s) of Spring for Apache Kafka are you seeing this issue?
Current, main branch.
Describe the bug
@KafkaListener(topics = "myTopic")
class MyListener {
@KafkaHandler(isDefault = true)
public void handleValue(@Header("kafka_receivedTopic") String topic, String message) {
// Anything.
}
}
public static void main() {
String myMessage = "msg";
template.send("myTopic", myMessage);
}
If we have listener with DefaultHandler,
the topic value is always same with message.
it means that equation below is true.
To Reproduce
You can refer to code snippet MyListener.
Expected behavior
- As-Is
- Either
topic or message are msg.
- To-Be
- The value of
topic should be 'myTopic'.
- The value of
message should be 'msg'.