spring-cloud-stream-binder-kafka: Magic v1 does not support record headers using spring boot 2.0 and kafka client 0.11.x
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'
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25 (13 by maintainers)
I was able to find a 0.10 broker in the cluster. Thanks so much for your help with this.