question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Magic v1 does not support record headers using spring boot 2.0 and kafka client 0.11.x

See original GitHub issue

I am trying to migrate to spring boot 2.0 but still use the kafka client 0.11.x. In the docs compatibility matrix it seems like this should work. I can get 1.5.8 to send messages with ‘kafka-clients’, version: ‘0.11.0.2’ and ‘spring-kafka’, version: ‘2.0.2.RELEASE’ with the following versions springBootVersion=1.5.8.RELEASE springCloudVersion=Edgware.SR1 springCloudStreamsVersion=Ditmars.SR2

However when I upgrade to the following versions springBootVersion=2.0.0.M7 springCloudVersion=Finchley.M5 springCloudStreamsVersion=Elmhurst.M3

kafka messages fail to send with the following error.
rg.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder$ProducerConfigurationMessageHandler@11eba03a]; nested exception is java.lang.IllegalArgumentException: Magic v1 does not support record headers at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:153) ~[spring-integration-core-5.0.0.RELEASE.jar:5.0.0.RELEASE]

I have confirmed that in both cases I see the print outAppInfoParser : Kafka version : 0.11.0.2 so I know the correct client version is being picked up.

I noticed that when I include the kafka dependencies I get an autoconfigure report on the console which makes me think something is not auto configuring correctly. I have dug through it but nothing stands out. I will include that in the comments.

This is the relevant bit of my build.gradle compile('org.springframework.cloud:spring-cloud-starter-stream-kafka') compile('org.springframework.cloud:spring-cloud-starter-stream-rabbit') compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.2' compile group: 'org.springframework.kafka', name: 'spring-kafka', version: '2.0.2.RELEASE' compile group: 'log4j', name: 'log4j', version: '1.2.17'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
kgangercommented, Feb 13, 2018

I was able to find a 0.10 broker in the cluster. Thanks so much for your help with this.

0reactions
seifeHucommented, Apr 17, 2019

Don’t comment on old, closed, issues. Open a new one if you have a real problem. You should ask questions on Stack Overflow, issues are not for questions.

This error is because of a mismatched client/server.

tks for reply .I write new one issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Kafka Producer not sending to Kafka ... - Stack Overflow
After updating the Kafka version to the latest I was not getting "Magic v1 does not support record headers" exception and the code...
Read more >
A magic error on Kafka - Stuck in the loop
IllegalArgumentException : Magic v1 does not support record headers at org.apache.kafka.common.record.MemoryRecordsBuilder.appendWithOffset( ...
Read more >
15. Apache Kafka Binder - Spring
For example, with versions earlier than 0.11.x.x, native headers are not supported. Also, 0.11.x.x does not support the autoAddPartitions property.
Read more >
I got Error info: Magic v1 does not support record headers
I got Error info: Magic v1 does not support record headers. ... spring-cloud-starter-stream-kafka version is 2.0.2.RELEASE
Read more >
Spring Kafka Producer not sending to Kafka 1.0.0 (Magic v1 ...
[Solved]-Spring Kafka Producer not sending to Kafka 1.0.0 (Magic v1 does not support record headers)-Springboot · score:2. Accepted answer. Solved. · score:0. you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found